The Treaty of Nanking, an unequal treaty between Britain and Qing dynasty China, ends the First Opium War on August 29, 1842, and establishes Hong Kong as a British colony until 1997.