The Qing dynasty ceded Hong Kong to the British Empire in 1842 through the treaty of Nanjing, ending the First Opium War.figure out