The story of Macao is retraced back to the Qin Dynasty (221–206 before Christ), when the area at present addressed Macao fell under the legal power of Panyu county, in the Nanhai prefecture of the state of Guangdong province.The 1st registered indwellers of the domain were people searching asylum in Macau from invasive Mongols during the Southern Sung dynasty.

In 1535, Portuguese dealers got the rights to cast anchor of their transports in Macao seaports and to accomplish merchandising actions, although not the right to stay onshore. Close to 1552–1553, they got impermanent license to set up storehouse sheds inshore, in order to dry commodity soaked from ocean water system. Macao formally turned into a Portuguese settlement in 1887 when the Qing governance was impelled to sign the Sino-Portuguese Treaty.