Prehistoric Hong Kong Archaeological studies show a human presence in the Chek Lap Kok area from 35, to 39, years ago and on Sai Kung Peninsula from 6, years ago. It is believed that the Three Fathom Cove was a river-valley settlement and Wong Tei Tung was a lithic manufacturing site. Excavated Neolithic artefacts suggested cultural differences from the Longshan culture of northern China and settlement by the Che people , prior to the migration of the Baiyue to Hong Kong.
Archaeological evidence indicates an increase of population and expansion of salt production. During the Tang dynasty , the Guangdong region flourished as an international trading centre.
A military stronghold was established in Tuen Mun to strengthen defence of the coastal area. However, subsequent military clashes between China and Portugal led to the expulsion of all Portuguese merchants in the s. To counter this deficit, the British began to sell increasingly large volumes of Indian opium to China. Faced with a drug addiction crisis, Chinese officials pursued ever more aggressive actions in an attempt to halt the opium trade.
In , the Daoguang Emperor , having rejected proposals to legalise and tax opium, tasked Imperial Commissioner Lin Zexu with eradicating the opium trade. Lin ordered the confiscation and destruction of all opium stockpiles in Canton and a general blockade of foreign trade.
British forces took formal possession of the island on 26 January However, disputes between high-ranking officials of both countries prevented the treaty's ratification. The inhabitants were mostly scattered in small farming and fishing villages across the island.
Though administrative infrastructure was very quickly built up, with official buildings constructed by early , the early years of colonial government were fraught with problems. Government officials had hoped to attract wealthy merchants from nearby port cities but a combination of frequent pirate incursions, rampant crime, restrictive Qing policies, endemic disease, and uncertainty over Hong Kong's future as a British possession discouraged them from establishing a presence.
Economic conditions and living conditions greatly improved during the Taiping Rebellion , when many wealthier Chinese fled from the turbulent conditions of the mainland and settled in the colony.
Hong Kong also became a stopping point for migrant workers en route to the United States, who hoped to benefit from the economic opportunities of the California Gold Rush. Because the Treaty of Nanking avoided addressing the legality of the opium trade, further tensions between the British and Qing eventually escalated into the Second Opium War. Following the Anglo-French victory in , the Convention of Peking expanded the colony to include Kowloon Peninsula south of present-day Boundary Street and Stonecutter's Island , both of which were ceded to the British in perpetuity.
The rapid economic improvement of the s attracted new foreign investment in the colony, as potential stakeholders became more confident in the financial future of the colony; the establishment of the Hongkong and Shanghai Bank , the city's first local bank, signaled the prosperity of the territory. Despite the rise of a British-educated Chinese upper class by the late 19th century, zoning laws prevented ethnic Chinese from acquiring property in reserved areas.
Though enacted ostensibly to address health concerns of European residents,  the Peak Reservation Ordinance and other similar pieces of legislation enforced a system of residential zoning that racially segregated the population of the colony, creating exclusive communities of Europeans in areas like Victoria Peak and Cheung Chau.
The British governors did rely, however, on a small number of Chinese elites, including Sir Kai Ho and Robert Hotung , who served as ambassadors and mediators between the government and local population. Chinese appointments to the Legislative Council and Executive Council were not made until and , with Wu Tingfang and Shouson Chow serving as the first members of the colony's ethnic majority on the respective chambers.
The colony continued to experience modest growth during the first half of the 20th century. The University of Hong Kong was established in as the territory's first higher education institute. During the First World War , many Chinese residents left the city, fearing a German attack on the colony. Japanese occupation of Hong Kong Originally constructed to commemorate the fallen in the First World War, the Cenotaph was later modified to honour victims of the Second World War and Japanese occupation of the territory.
The Battle of Hong Kong lasted for 17 days, through which British, Canadian, Indian, and local colonial units defended the territory. Believing that the Japanese would attempt a naval assault, the garrison concentrated its efforts on holding Hong Kong Island and was not sufficiently prepared to defend the mainland portion of the colony.
Despite the inevitability of defeat, Governor Mark Young persisted with the defence of the island at Winston Churchill 's insistence, so that other British colonies might have more time to prepare to defend against their own imminent invasions. With the garrison unable to further mount an effective defence, Young surrendered the colony on Christmas Day. Widespread starvation and forced deportation of residents to mainland China drastically reduced the population of the city from 1.
More than ten thousand civilians were executed, with more subjected to torture, rape, or physical mutilation. The Kenpeitai were notorious for their exceptional brutality; public beheadings were routine at King's Park and Chinese residents were often used as shooting or bayonet practice targets. Hong Kong's population recovered quickly after the war, as a wave of skilled migrants from the Republic of China sought refuge from the Chinese Civil War in a territory neutral to the conflict.
When the Communist Party took full control of mainland China in , even more refugees fled across the open border in fear of persecution. In , a boundary zone was demarcated as a buffer zone against potential military attacks from communist China. In the s, Hong Kong became the first of the Four Asian Tiger economies to undergo rapid industrialisation driven by textile exports, manufacturing industries, and re-exports of goods to China.
As the population grew, with labour costs remaining low, living standards began to rise steadily. Systemic corruption in the uniformed services had crippled trust in the government; MacLehose established the ICAC , an independent security service under the direct authority of the Governor, to restore the integrity of the civil service.