Portuguese ships began arriving in 1513. In the 1550s, Portuguese paying tribute to China settled in Macau, which became the official entrepôt for all international trade with China and Japan and the first European settlement in the Far East. The first governor was appointed in the 17th century, but the Portuguese remained largely under the control of the Chinese. In the 1930s and ’40s Macau was declared a neutral territory during the Sino-Japanese War and World War II and became a refuge for both Chinese and Europeans. Portugal officially made Macau an overseas province in 1951.
In April 1987, Portugal and China reached an agreement to return Macau to Chinese rule in 1999, using the Hong Kong Joint Declaration between China and the UK as a model. In this agreement, China promised that, under its "one country, two systems" formula, China's political and economic system would not be imposed on Macau, and that Macau would enjoy a "high degree of autonomy" in all matters except foreign affairs and defense for the next 50 years. However, after China's multi-year crackdown against the pro-democracy movement in nearby Hong Kong, the governments of China and the Macau Special Administrative Region worked to limit Macau's political autonomy by suppressing opposition activity in the 2021 legislative elections.