Nanyue (), was an ancient kingdom founded by the Chinese general Zhao Tuo, whose family (known in Vietnamese as the Triệu dynasty) continued to rule until 111 BC. Nanyue's geographical expanse covered the modern Chinese subdivisions of Guangdong, Guangxi, Hainan, Hong Kong, Macau, southern Fujian and central to northern Vietnam. Zhao Tuo, then Commander of Nanhai Commandery of the Qin dynasty, established Nanyue in 204 BC after the collapse of the Qin dynasty. At first, it consisted of the commanderies of Nanhai, Guilin, and Xiang.
Nanyue and its rulers had an adversarial relationship with the Han dynasty, which referred to Nanyue as a vassal state while in practice it was autonomous. Nanyue rulers sometimes paid symbolic obeisance to the Han dynasty but referred to themselves as emperor. In 113 BC, fourth-generation leader Zhao Xing sought to have Nanyue formally included as part of the Han Empire. His prime minister Lü Jia objected vehemently and subsequently killed Zhao Xing, installing his elder brother Zhao Jiande on the throne and forcing a confrontation with the Han dynasty. The next year, Emperor Wu of Han sent 100,000 troops to war against Nanyue. By the year's end, the army had destroyed Nanyue and established Han rule. The dynastic state lasted 93 years and had five generations of monarchs.
The existence of Nanyue allowed the Lingnan region to avoid the chaos and hardship surrounding the collapse of the Qin dynasty experienced by the northern, predominantly Han Chinese regions. The kingdom was founded by leaders originally from the Central Plain of China and were all of Han Chinese in origin. They were responsible for bringing Chinese-style bureaucracy and handicraft techniques to inhabitants of southern regions, as well as knowledge of the Chinese language and writing system. Nanyue rulers promoted a policy of "Harmonizing and Gathering the Hundred Yue tribes" (), and encouraged ethnic Han to immigrate from the Yellow River region to the south. Nanyue rulers were then not against the assimilation of Yue and Han cultures.