In the 16th Century, China gave Portugal the right to settle in Macau in exchange for clearing the area of pirates under strict Chinese administration. Macau was the first European settlement in the Far East. It became Portuguese colony effectively after the treaty signed by Qing and Portuguese Government in 1887. It was also the last, when pursuant to an agreement signed by China and Portugal in 1987, Macau became the Macau Special Administrative Region (SAR) of China on 20 December 1999, ending over 400 years of Portuguese administration.
China has promised that, under its "one country, two systems" formula, China's socialist economic system will not be practiced in Macau for at least fifty years after the transfer of sovereignty and that Macau will enjoy a high degree of autonomy in all matters except foreign and defense affairs.
As an SAR, Macau has its own government and police force, passports, visas, postal system and currency.