The Treaty of Nanjing was a peace accord signed on August 29, 1842, between the United Kingdom and the Qing Dynasty of China. It marked the end of the First Opium War, initiating a century of Western influence and opening several treaty ports to foreign trade.