Macau takes its name from A-Ma-Gau harbour, which in turn is named for A-Ma, the goddess of seafarers. In the 16th century A-Ma's protective powers were expanded to include seafarers from the other side of the world - the Portuguese. The famous seafarers first set foot on Chinese soil in 1513, having heard of the 'Empire of the Chins' from their trading outposts in India and Malacca. An official trading arrangement was drawn up in the 1550s and the Portuguese opted to settle on the peninsula which had frequently offered them safe anchorage, with inner and outer harbours and sheltered islands to the south. A rental arrangement was agreed upon, and in return the Portuguese promised to rid the area of marauding pirates.
The port soon prospered, thanks to its strategic position midway on the lucrative trading route between India's west coast, Malacca and Japan. Chinese merchants were forbidden on pain of death to go abroad, and they eagerly embraced the opportunity to hire the Portuguese as agents. The wealth generated by Portugal's monopoly on trade between China and Japan was used to create a home away from home of luxurious European houses and baroque churches. Macau became a centre not only of trade in the Far East, but also of Christianity, with the Jesuit missionaries' Basilica de São Paulo hailed as the greatest monument to Christianity in the East.
But Portuguese fortunes were on the wane back home and the colonial ambitions of nations such as Holland were posing a threat, with the Dutch making two serious attacks on Macau in 1607 and 1627. Macau's golden age came to an abrupt end in the 1630s when Japan was closed to foreign trade, the Dutch took Malacca by force, and the port of Guangzhou was closed to the Portuguese. The golden port became an impoverished backwater.
Restrictions regulating the activities of non-Portuguese residents were lifted in the mid-18th century and Macau temporarily revived as a Chinese outpost for European traders - but only until 1841, when the British came along and took possession of Hong Kong. Macau's economic woes were forever eased by the introduction of licensed gambling in the 1850s, and the arrival of successive waves of refugees boosted the tiny enclave's population.