The Treaty of Nanking (Nanjing) was a peace treaty which ended the First Opium War (1839–1842) between the United Kingdom and the Qing dynasty of China on 29 August 1842. It was the first of what the Chinese later called the unequal treaties.
In the wake of China's military defeat, with British warships poised to attack Nanking, British and Chinese officials negotiated on board HMS Cornwallis anchored at the city. On 29 August, British representative Sir Henry Pottinger and Qing representatives Qiying, Yilibu, and Niu Jian signed the treaty, which consisted of thirteen articles. The treaty was ratified by the Daoguang Emperor on 27 October and Queen Victoria on 28 December. Ratification was exchanged in Hong Kong on 26 June 1843. A copy of the treaty is kept by the British government while another copy is kept by the Ministry of Foreign Affairs of Republic of China at the National Palace Museum in Taipei.
The first working draft for articles of a treaty was prepared at the Foreign Office in London in February 1840. The Foreign Office was aware that preparing a treaty containing Chinese and English characters would need special consideration. Given the distance separating the countries, it was realised that some flexibility and a departure from established procedure in preparing treaties might be required.