|This article is part of a series on the|
|History of Hong Kong|
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.
See also: Baiyue
Prior to the Qin dynasty, the area was populated by a large family of non-Chinese tribes known as the Yue people (Chinese: 越; Sidney Lau: Yuet6). 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" (Chinese: 郡; pinyin: jùn; Sidney Lau: gwan6)- 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.
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.
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.
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.
Main article: Battle of Tamão
In the early 16th century during the Ming dynasty, Hong Kong's earliest recorded non-Asian visitor arrived in the person of Portuguese mariner Jorge Álvares in 1513. After Alvares settled in Hong Kong, Portuguese merchants began trading in Southern China. At the same time, they invaded and built up military fortifications in Tuen Mun. Military clashes between China and Portugal ensued and the Portuguese were expelled. However, the Portuguese reestablished trade relations by 1549 with annual trade missions sent to Shangchuan Island and, due to the diplomatic efforts of Leonel de Sousa (a later Governor of Macau), acquired a lease from Ming authorities for a trade colony at Macau in 1557.
In the mid-16th century, the maritime prohibition policy came into effect. Designed to prevent contact with foreigners, it also restricted local sea activity. Villagers in Hong Kong coastal areas were ordered to move to mainland China. To further reduce the population of an estimated 16,000 in the territory, the transition from the Ming dynasty to the Qing dynasty led to the flushing out of Ming rebels. Qing officials forced many Hong Kong villagers back to the mainland through the destruction of villages and crops, which caused famine.
Hong Kong was governed under Xin'an County (新安縣) during the Ming dynasty.
From 1661 to 1669, the territory was affected by the Great Clearance, ordered by the Qing dynasty's Kangxi Emperor, which required the evacuation of the coastal areas of Guangdong. It is recorded that about 16,000 persons from Xin'an County were driven inland and 1,648 of those who left are said to have returned when the evacuation was rescinded in 1669. What is now the territory of Hong Kong became largely wasteland during the ban.
The Hakka people became the dominant group to occupy the territory, today they are integrated into the very fabric of Hong Kong with many traditional villages still in place in the New Territories. Hakka people are a distinct subgroup with their own distinct cuisine that comprises many traditional and famous dishes.
Henry Pottinger made his way to Asia in 1841 to eventually become the first Governor of Hong Kong under British rule by 1842, thus ending the reign of Imperial China over Hong Kong.