Hong Kong was under British rule from 1841 to 1997, except for a brief period of Japanese occupation during the Second World War from 1941 to 1945. It was a Crown colony of the United Kingdom from 1841 to 1981, and a dependent territory from 1981 to 1997. The colonial period began with the British occupation of Hong Kong Island under the Convention of Chuenpi in 1841 of the Victorian era, and ended with the handover of Hong Kong in July 1997.
In accordance with Article III of the Treaty of Nanking of 1842, signed in the aftermath of the First Opium War, the island of Hong Kong was ceded in perpetuity to Great Britain. It was established as a Crown colony in 1843. In 1860, the British expanded the colony with the addition of the Kowloon Peninsula and was further extended in 1898 when the British obtained a 99-year lease of the New Territories. Although the Qing had to cede Hong Kong Island and Kowloon in perpetuity as per the treaty, the leased New Territories comprised 86.2% of the colony and more than half of the entire colony's population. With the lease nearing its end during the late 20th century, Britain did not see any viable way to administer the colony by dividing it, whilst the People's Republic of China would not consider extending the lease or allowing continued British administration thereafter.