Modern-day Hong Kong is best known for its sprawl of skyscrapers, a bustling financial hub off the southern coast of mainland China and a regional conduit for trade.
But the territory was once a quiet backwater of rural hamlets and fishing communities, where mountainous terrain dominated sparse human settlement.
Twenty years since the city was handed back to China by colonial power Britain here are key points in its evolution:
Remnants of burial grounds and early rock carvings show human life in Hong Kong as far back as the Stone Age.
The territory is thought to have come into the fold of the Chinese empire under the Han dynasty between 206 BC and 220 AD.
Increasing numbers of Han Chinese from the mainland began to settle in Hong Kong, alongside boat-dwelling communities also thought to have originated from southern China.
Hong Kong's sheltered main harbour became a place to replenish supplies for trading ships plying the maritime silk road between Asia, Africa, and the Middle East, which flourished from around the 7th century.
As well as silk, China exported porcelain and tea and received everything from spices to plants and textiles.
Hong Kong's outlying islands were also a haven for Chinese pirates -- its current territory includes 260 islands, many of them uninhabited.
Portuguese, Dutch and French traders arrived on the south coast of China in the 1500s and Portugal set up a base in Macau, neighbouring Hong Kong.
But in the 18th century China imposed restrictions on the Europeans in a bid to contain their influence.
Britain was angered after an imperial edict banned its trade in opium from India to China, which had led to the spread of addiction.
After Chinese authorities seized a vast haul of the drug, Britain attacked in 1840 and reached northern China, threatening Beijing, in the First Opium War.
To make peace, China agreed to cede Hong Kong Island to Britain in 1841.
The Kowloon peninsula followed in 1860 after a second Opium War and Britain extended north into the rural New Territories in 1898, leasing the area for 99 years.
Hong Kong was part of the British empire until 1997, when the lease on the New Territories expired and the entire city was handed back to China.
Under British rule, Hong Kong transformed into a commercial and financial hub boasting one of the world's busiest harbours.
Anti-colonial sentiment fuelled riots in 1967 which led to some social and political reforms -- by the time it was handed back to China, the city had a partially elected legislature and retained an independent judiciary.
Hong Kong boomed as China opened up its economy from the late 1970s, becoming a gateway between the ascendant power and the rest of the world.
Return to China
After lengthy negotiations, including between Deng Xiaoping and British Prime Minister Margaret Thatcher, the future handover of Hong Kong was signed off by the two sides in 1984.
The Sino-British declaration said Hong Kong would be a "Special Administrative Region" of China, and would retain its freedoms and way of life for 50 years after the handover date on July 1, 1997.
While initial fears of a crackdown did not materialise, concerns have grown in recent years that China is tightening its grip.
Democratic reforms promised in the handover deal have not materialised and young activists calling for self-determination or independence have emerged.