evidence: Following the 1839–42 First Opium War Portugal gained control of Taipa and Coloane in 1851 and 1864 respectively. In December 1887, the Qing Dynasty and Portuguese governments agreed to the Sino-Portuguese Treaty of Amity and Commerce which gave Portugal perpetual occupation and government of Macau. After the establishment of the People’s Republic of China, the Beijing government abrogated the Sino-Portuguese Treaty of Amity and Commerce on the basis that it was invalid as an unequal treaty imposed by foreigners on China. Negotiations regarding Macau, however, did not start until 1976. In 1979, Macau became defined as "a Chinese territory under temporary Portuguese administration". In 1988, Portugal and China signed the Sino-Portuguese Joint Declaration making Macau a special administrative region of China. China took formal sovereignty over Macau on 20 December 1999 under the policy of "one country, two systems" in which the People’s Republic of China oversees Macau’s international relations and defense while allowing Macau a large degree of political, its legal framework is based largely on Portuguese law. This was an important moment for China as it marked the last of the foreign occupied ‘concessions’ to be returned to mainland control.