The History of Hong Kong under Imperial China began in 214 BC during the Qin dynasty. The territory remained largely unoccupied until the later years of the Qing dynasty when Imperial China ceded the region to Great Britain under the 1842 Treaty of Nanking, whereupon Hong Kong became a British Colony.
Prehistory to Han dynasty (before 200 AD)
Prior to the Qin dynasty, the area was populated by a large family of non-Chinese tribes known as the Yue people (). Little is known for certain about the Yue people other than from information gleaned from ancient Chinese records and modern archaeological excavations. Their language is believed to have been Austroasiatic, although a clear consensus has yet to be reached on its more specific aspects.
Shortly after consolidating his rule over China in 221 BC, the First Emperor of the Qin dynasty sent a large army to conquer the Yue tribes and bring what is now southern China under Qin control. In 214 BC, Qin armies defeated the Yue tribes, and the area was annexed as Qin territory. The Qin dynasty organized its territory into "commanderies" ()- roughly equivalent to modern day provinces - and the territory of what is now Guangdong and Hong Kong became part of the Nanhai Commandery.
The First Emperor's death in 210 BC precipitated a number of revolts and insurrections throughout China. Zhao Tuo, a Han Chinese general who had marched south with the Qin army, declared the founding of a kingdom called Nanyue, with himself as king and a capital at Panyu (modern Guangzhou). Nanyue became a successful kingdom that had a mostly Han Chinese ruling elite with a large number of native Yue inhabitants as lesser leaders and officials. Artifacts from the period have been found throughout the greater Guangzhou area, but none have yet been found in Hong Kong.
Nanyue was conquered by the Han dynasty around 112 BC after the Han–Nanyue War. In the 1950s, a tomb at Lei Cheng Uk dating from the Eastern Han dynasty (25–220 AD), was discovered and excavated. Artifacts found in the tomb caused some archaeologists to believe that salt production flourished in the area during this period, although conclusive evidence has yet to have been found. The first Han Chinese settlement of the Hong Kong area likely dates to this period.
Tang dynasty (618–907 AD) During the Tang dynasty, the Guangdong region flourished as an international trading center. The Tuen Mun region in what is now Hong Kong's New Territories served as a port, naval base, salt production centre and later a base for the exploitation of pearls. Lantau Island was also a salt production centre where salt smugglers rioted against the government.
Song dynasty (960–1279 AD)
The earliest known written reference to an event in Hong Kong is part of a 108–character stone inscription (now a declared monument of Hong Kong) on the southern tip of a peninsula in Joss House Bay, east of Tseung Kwan O. It refers to the construction of a stone pagoda on adjacent Tung Lung Island in the fifth year of the reign of Emperor Zhenzong of the Northern Song dynasty in 1012 AD. The engraving itself is dated to the Jiashu year (1274 AD) of Emperor Duzong's reign during the Southern Song dynasty, making it the oldest historical relic with a definite date in Hong Kong and Kowloon.
During the Northern Song dynasty, village schools such as Li Ying College were established around 1075 in the New Territories to provide Imperial Chinese education.
In 1276, during the Mongol invasion, the imperial court of the Southern Song dynasty moved to Fujian, then to Lantau Island and later to today's Kowloon City, but the child Song emperor, Zhao Bing, after his defeat at the Battle of Yamen committed suicide by drowning with his officials. Tung Chung valley, named after a hero who gave up his life for the emperor, is believed to have been a base for the court. Hau Wong, an official of the emperor is still worshipped in Hong Kong today. By the end of the Song dynasty, the first major clan to arrive was the Tang's (Deng, 鄧). They mostly settled in the valleys and plains of the New Territories area.
Yuan dynasty (1271–1368) During the Mongol-led Yuan dynasty, Hong Kong saw its first population boom as Chinese refugees migrated to the area. The five families of Tang (Deng, 鄧), Hau (Hou, 侯), Pang (Peng, 彭) and Liu (Liao, 廖) and Man (Wen, 文) were claimed to be among the earliest recorded settlers of Hong Kong. While they are recognised by family surnames, they arrived first mostly in the form of clans. Despite the immigration and light development of agriculture, the area was still relatively barren and had to rely on the salt, pearl and fishery trades to produce income.
Ming dynasty (1368–1644)