It was only with the signing of the Sino-Portuguese Treaty of Peking in 1887 that the Qing court formally accepted permanent Portuguese control of Macau. In return, the Portuguese promised not to cede the colony to any third country.
光緒十三年，《中葡北京條約》簽訂，清廷終於書面同意葡萄牙永遠居管澳門；葡人則允許不將澳門讓予第三國。