When the Portuguese landed in Macau in 1516, it was little more than a fishing village on the Pearl River Delta. In 1557, the Chinese allowed the Portuguese to establish a settlement, but sovereignty remained with China, with only a local Portuguese administration established. The Portuguese used Macau as a trading post and stopover on their way from Lisbon to Nagasaki.
When China banned direct trade with Japan in 1547, trade continued on Macao. The Portuguese built the site into a port city and finally the center of their presence in Asia. In June 1622, an attempt of conquest of the Dutch was repulsed. Macao was governed by a governor, who was at times responsible for the entire East Asian territories, but was formally under the viceroy / governor-general of India in Goa.
Source: Wikipedia and Wolfgang Morscheck Bad Säckingen from Germany