linguistic:voice_change, stylistic:style_transfer
British colony

In 1839, the Daoguang Emperor rejected proposals to legalise and tax opium and ordered imperial commissioner Lin Zexu to eradicate the opium trade. The commissioner destroyed opium stockpiles and halted all foreign trade, triggering a British military response and the First Opium War. The Qing surrendered early in the war and ceded Hong Kong Island in the Convention of Chuenpi. British forces began controlling Hong Kong shortly after the signing of the convention, from 26 January 1841. However, both countries were dissatisfied and did not ratify the agreement. After more than a year of further hostilities, Hong Kong Island was formally ceded to the United Kingdom in the 1842 Treaty of Nanking.

Administrative infrastructure was quickly built by early 1842, but piracy, disease, and hostile Qing policies initially prevented the government from attracting commerce. Conditions on the island improved during the Taiping Rebellion in the 1850s, when many Chinese refugees, including wealthy merchants, fled mainland turbulence and settled in the colony. Further tensions between the British and Qing over the opium trade escalated into the Second Opium War. The Qing were again defeated and forced to give up Kowloon Peninsula and Stonecutters Island in the Convention of Peking. By the end of this war, Hong Kong had evolved from a transient colonial outpost into a major entrepôt. Rapid economic improvement during the 1850s attracted foreign investment, as potential stakeholders became more confident in Hong Kong's future.

The colony was further expanded in 1898 when the United Kingdom obtained a 99-year lease of the New Territories. The University of Hong Kong was established in 1911 as the territory's first institution of higher education. Kai Tak Airport began operation in 1924, and the colony avoided a prolonged economic downturn after the 1925–26 Canton–Hong Kong strike. At the start of the Second Sino-Japanese War in 1937, Governor Geoffry Northcote declared Hong Kong a neutral zone to safeguard its status as a free port. The colonial government prepared for a possible attack, evacuating all British women and children in 1940. The Imperial Japanese Army attacked Hong Kong on 8 December 1941, the same morning as its attack on Pearl Harbor. Hong Kong was occupied by Japan for almost four years before the British resumed control on 30 August 1945.

Its population rebounded quickly after the war, as skilled Chinese migrants fled from the Chinese Civil War and more refugees crossed the border when the Chinese Communist Party took control of mainland China in 1949. Hong Kong became the first of the Four Asian Tiger economies to industrialise during the 1950s. With a rapidly increasing population, the colonial government attempted reforms to improve infrastructure and public services. The public-housing estate programme, Independent Commission Against Corruption, and Mass Transit Railway were all established during the post-war decades to provide safer housing, integrity in the civil service, and more reliable transportation.

Nevertheless, widespread public discontent resulted in multiple protests from the 1950s to 1980s, including pro- Republic of China and pro- Chinese Communist Party protests. In the 1967 Hong Kong riots, pro- PRC protestors clashed with the British colonial government. As many as 51 were killed and 802 were injured in the violence, including dozens killed by the Royal Hong Kong Police via beatings and shootings.

Although the territory's competitiveness in manufacturing gradually declined because of rising labour and property costs, it transitioned to a service-based economy. By the early 1990s, Hong Kong had established itself as a global financial centre and shipping hub.