The Treaty of Nanking or Nanjing was a peace treaty which ended the First Opium War (1839–42) 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 treatiesbecause Britain had no obligations in return.