Macau was under Portuguese rule from the establishment of the first official Portuguese settlement in 1557 until its handover to China in 1999. It comprised the Municipality of Macau and the Municipality of Ilhas. Macau was both the first and last European holding in China.Dillon, Michael (2017). Encyclopedia of Chinese History. New York: Routledge. p. 418. .

Macau's history under Portugal can be broadly divided into three distinct political periods.Cardinal 2009, p. 225 The first was the establishment of the Portuguese settlement in 1557 to 1849.Halis 2015, pp. 70–71 The Portuguese had jurisdiction over the Portuguese community and certain aspects of the territory's administration but no real sovereignty. Next came the colonial period, which scholars generally place from 1849 to 1974.Hao 2011, p. 40 As Macau's importance among other territories grew within the Portuguese Empire, Portuguese sovereignty over Macau strengthened and it became a constitutional part of Portuguese territory. Chinese sovereignty during this era was mainly nominal. Finally, in the aftermath of the 12-3 incident in 1966, the third was the transition period or post-colonial period, after the Carnation Revolution in 1974 until the handover in 1999.Halis 2015, pp. 72–73

Wu Zhiliang, President of the Macau Foundation, more specifically identified six periods:Hao 2011, pp. 31–32, 224

The early relationship between the Chinese and Portuguese (1514–1583) The Senado (Senate) period (1583–1783) The decline of the Senado (1783–1849) The colonial period (1849–1976) The district autonomy period (1976–1988) The transition period (1988–1999)

Macau was officially known as the Province of Macau (, ) until 1976, and subsequently Territory of Macau (, ).

History In 1277, about 50,000 supporters and some members of the Song dynasty, fleeing the Mongol invaders, arrived in Macau and built several settlements, the largest and most important being in the Mong-Há region in the north of Macau. It is believed that the oldest temple in Macau, the Temple of Kun Iam (Goddess of Mercy), was located in Mong-Há.

During the Ming dynasty, many fishermen from Guangzhou and Fujian settled in Macau and built the Temple of A-Ma.

Arrival of the Portuguese The first Portuguese to visit China was Jorge Álvares in 1513, during the Age of Discovery. He erected a padrão with the arms of Portugal in the port of Tamão at the mouth of the Pearl River, near Macau. This visit was followed by the establishment of numerous Portuguese traders in the area, who would erect temporary wooden buildings that would be destroyed when the traders left. The Portuguese were not yet allowed to stay, obtaining only visitor status.

In 1517, Fernão Pires de Andrade, the head of a Portuguese expedition to China, managed to negotiate with the Chinese authorities in Canton for the entry of the Portuguese ambassador Tomé Pires to Beijing and the establishment of a trading post in Tamão. Due to the aggressive attitudes of his brother Simão de Andrade (who built a fortress in Tamão), Tomé Pires was thrown into prison by the Chinese authorities where he died and the Chinese Emperor forbade trade with the Portuguese. The Portuguese were then chased away from Cantonese waters in two successive battles, the 1521 Battle of Tunmen and the 1522 Battle of Sincouwaan, marking the end of the Tamão settlement.

Despite this setback, Portuguese traders continued their activity up the coast of China, eventually settling in Shuangyu. In 1548, this community was razed by a Chinese army, dispersing the Portuguese to the Dongshan Peninsula, where Galeote Pereira was captured by the Chinese in 1549. During these battles the Chinese captured weapons from the Portuguese which they then reverse engineered and mass produced in China. These included matchlock arquebuses, which they named bird guns, and breech loading swivel guns which they named Folangji (Frankish) cannons because the Portuguese were known to the Chinese as "Franks" at this time.

The Portuguese later returned to the coast of Guangdong and the islands of Shangchuan and Lampacau to conduct their commercial transactions. They began establishing trade relations with the Chinese from the port of Macau. They presented themselves as Portuguese instead of Franks in the Luso-Chinese agreement (1554) and rented Macau as a trading post from China by paying annual lease of hundreds of silver taels to Ming China.p. 343-344, Denis Crispin Twitchett, John King Fairbank, The Cambridge history of China, Volume 2; Volume 8, Cambridge University Press, 1978,

Founding of Macau Macau as a commercial port dates back to 1535 during the Ming dynasty, when local authorities established a custom house, collecting 20,000 taels in annual custom duties.Chang, T'ien-Tse (1933). Sino-Portuguese Trade from 1514 to 1644: A Synthesis of Portuguese and Chinese Sources. Leyden: E. J. Brill. p. 93. Sources also call this payment a rent or bribe.Strauss, Michael J. (2015). Territorial Leasing in Diplomacy and International Law. Leiden: Brill Nijhoff. p. 58. .

In 1554, the custom house was moved to Lampacao, likely due to threats of piracy. At the same time, the merchants Leonel de Sousa and Simão d'Almeida offered bribes to Wang Bo, the vice-commissioner for maritime defense. After a pleasant reception from the Portuguese merchants on their ships, the two sides agreed to a payment of 500 taels per year made personally to Wang Bo in return for allowing the Portuguese to settle in Macau as well as levying the imperial duty of 20 percent on only half their products. However they were asked to leave during the winter, a practice which lasted until 1557. By 1557, they established a permanent settlement.Mendes 2013, p. 10Twitchett, Denis; Mote, Frederick W., eds. (1998). The Cambridge History of China. Vol. 8. Cambridge: Cambridge University Press. p. 344. .

The Portuguese ambassador Diogo Pereira arrived in 1563 to normalize relations and in 1568, the Portuguese helped the Chinese to fight off a hundred pirate ships, strengthening their position in Macau.Rêgo, António da Silva (1994). "Direct Sailings Between Macao and Brazil: An Unrealizable Dream? (1717–1810)". Review of Culture. No. 22 (2nd series). Cultural Institute of Macao.

The nature of Wang Bo's business transactions was almost discovered by imperial observers in 1571, but the vice-commissioner obfuscated the payments by identifying them as "ground rent" made to the imperial treasury. Macau's merchant oligarchs continued to bribe their Mandarin overseers and in this way the settlement persisted. The most important incident of bribery occurred in 1582 when the viceroy of Guangdong and Guangxi summoned Macau's chief officials for a meeting. Remembering the fate of Tome Pires decades earlier, Macau's leaders chose an elderly judge and Italian Jesuit to go in their place. The viceroy raged at the Macau representatives, accusing them of conducting governance in contravention of Ming law, and threatened to destroy the colony and evict all Portuguese from Macau. His attitude changed dramatically after the two presented him with 4,000 cruzados worth of presents. In his words: "The foreigners, subjects to the laws of the Empire, may continue to inhabit Macao."

The name of Macau seems to have originated in one of the first places accessed by the Portuguese, the Bay of A-Má ("A-Ma Gao" in Cantonese), named after a local temple of the goddess A-Má. A-Ma Gao would become, Amacao, Macao and, finally, Macau.

At the time, the Portuguese commercial establishment of Macau was only a small village with a few blocks, churches, and residences, joined by a small number of streets. Most of the population lived on trade, so many left Macao for months and sometimes years to carry out their trading. At that time, it had a vaguely defined political-administrative organization, as the Portuguese Crown had not yet properly planned for Macau. Therefore, at that time, the Captain-Major of the Voyage of China and Japan was responsible for the affairs of the Portuguese during his stay in Macau. As the only existing authority, he sought to maintain order among the Portuguese while his great merchant ship was in port.

Over time, issues emerged whose resolution could not wait for the Captain-Major's return from his trips to Japan, so a kind of triumvirate was formed, which began to direct the administration of the establishment. It was composed of three representatives of the residents, called homens-bons ("good men"), chosen by vote. In 1562, one of those elected became, by choice, Land Captain. These three representatives continued to be nevertheless dependent on the Captain-Major. Specifically, the function of these three representatives was to regulate all matters of public order and politics. In addition to the triumvirate, there was also a judge, and four merchants elected by the people who participated in the administration. These elements together formed a kind of council.

Although the Portuguese remained in Macau, the Chinese authorities maintained that Macau was an integral part of the Chinese Celestial Empire, so the Portuguese had been obligated to pay annual rent (about 500 taels of silver) and certain taxes to the Chinese since 1573. The governor of Guangdong, the highest Chinese authority in the region, ordered some mandarins in the vicinity of Macau to watch and supervise the Portuguese commercial establishment, namely with regard to the collection of rent and taxes levied by the Guangzhou authorities on all Chinese products and on all products exported by the Portuguese. These Chinese officials exercised great influence over the administration of Macau and also exercised control and ultimate jurisdiction over all Chinese residents in Macau. Many of them lived in the north of the peninsula.

In 1573 or 1574, the Chinese authorities ordered the construction of a barrier on the northern border of the Peninsula, in a place very close to the present-day Portas do Cerco, to prevent the expansion of the Portuguese through the island of Xiangshan (modern Zhongshan), to supervise better the collection of taxes on goods entering or leaving the city, and to control Macau's supply.

Catholic Church in early Portuguese Macau

Macau also became an important point of departure for Catholic missionaries to different countries in Asia, namely China and Japan. In addition to evangelization, these missionaries, especially the Jesuits, also promoted ethical, cultural, and scientific exchange between the West and the East; and contributed in an important way to the development of Macao. Belchior Carneiro Leitão, the first Governor of the Bishopric of Macau, founded, in 1569, the first hospital in Macau, Hospital dos Pobres (later to be called "Hospital de São Rafael"), and the first European institution charity in this region, the Santa Casa da Misericórdia. These religious Catholics also contributed to the development of social assistance, creating orphanages and even a leper colony, and education in Macau.

The Colégio de São Paulo was founded in the 16th century and the Seminary of São José in the 18th century. These two institutions had the function of training missionaries and priests. Due to the great importance of Macau, Pope Gregory XIII created the Diocese of Macau on 23 January 1576. Due to the lack of priestly vocations, the seminary was closed and the College was destroyed by fire in 1835.

On several occasions, the Jesuits who regularly attended the court in Beijing used their influence to save Macau from various dangers and from various exaggerated demands imposed by the Chinese authorities in Guangzhou or by the Emperor himself.

Goa-Macau-Nagasaki trade