The Nanman ("Southern Barbarians"), also known as the Baiyue ("Hundred Yue"), were an East Asian indigenous people native to the Chinese heartland south of the Yangtze, as well as present-day Vietnam. One of Vietnam's founding myths attributes the ethnogenesis of the Vietnamese people to the Nanman king Lac Long Quan and his wife, the fairy Au Co, who gave him an egg sack which spawned the 100 ancestors of the "Hundred Yue" peoples, one of whom would form the Luoyue (Lac Viet) people, who supposedly evolved into the present-day Vietnamese people. In addition, some of the Yue had ancestral tongues similar to that of modern Thai, just as the present-day Nanman descendants, the Zhuang of southern China, have strong linguistic ties with Thailand. Archaic Tibeto-Burman languages may also have been spoken among the ancient Yue, and pockets of these languages are still spoken among minority populations in southern China. The Fujian Nanman spoke proto-Austonesian languages, and, in 4000 BC, they crossed the strait to settle Taiwan before voyaging across the Pacific and forming the ancestors of the Malays, Indonesians, and Polynesians. People as far-flung as New Zealand and Hawaii may have been the distant descendants of the Nanman peoples.
These animist tribes formed sedentary communities along the Yangtze and Pearl River deltas by 5000 BC, cultivating rice and raising water buffalo. During the Spring and Autumn period, the Nanman formed the State of Wu and the State of Yue, which became bitter rivals. In 482 BC, Yue conquered Wu, forming a consolidated southern Chinese state; however, many other Yue tribal confederations existed outside of this state. The ancient Baiyue peoples kept their hair short, tattooed their face and bodies, blackened their teeth, and wore plant-fiber and tree-bark clothing and fish-skin hats. They also settled in communities among the bamboo groves. The Yue were considered to be barbarians by the Han Chinese, as the Han looked down on their different clothing, languages (which they compared to animal shrieks), and their living habits; they also claimed that the animist Yue had shamans who read divinations from chicken bones, and that they worshipped snakes. The coastal people of the south were renowned shipbuilders and metallurgists, and they became known as prominent merchants who established trade networks across Southeast Asia.
During the reign of Qin emperor Qin Shi Huang in the late Warring States Period, he organized the southwards emigration of 500,000 Northern Chinese settlers (most of whom were convicted felons and exiles) to colonize the south. During the Chu-Han Contention, the Yue tribes formed the kingdoms of Minyue (Fujian) and Nanyue (spanning from Guangdong to southern Vietnam).
Under Emperor Wudi of Han, the Han absorbed the Yue through conquest, deporting the people of Minyue to the land between the Changjiang and Huai Rivers and sending Chinese merchants, bureaucrats, scholars, and soldiers to assimilate the remaining inhabitants of Southern China. In 43 BC, the sisters Trung Trac and Trung Nhi launched a famous rebellion which drove the Han out of Vietnam, but their rebellion was eventually put down by a Han counteroffensive. During the Fall of the Han from 184 to 220 AD, warlords seized control of the remnants of Han China. In the southern kingdoms of Wu and Shu, major pockets of unassimilated Nanman persevered, sharing strong cultural affinities with the original Nanman peoples.
In 221 AD, Shamoke rebelled against Wu in the valley gorges of Hunan, joining forces with Shu at the Battle of Yiling before being slain in battle a year later. Nanman tribes in Nanzhong rebelled against Shu following Liu Bei's death, spearheaded by King Meng Huo, his wife Zhu Rong, and King Mulu. Emperor Liu Shan sent his general Zhuge Liang to crush the rebellion in his famed "Nanman Campaign", defeating the Nanman seven times before convincing Meng Huo and his allies to surrender and pay tribue to Shu. By the 7th century AD, the Nanman had become mostly assimilated, becoming the ancestors of Fujian, Guangdong, Guangxi, and Yunnan. However, not all of the Nanman's descendants disappeared, as Vietnam remained an independent civilization, as did the peoples of Thailand and Burma and the Aborigines of Taiwan. Hokkien, Hakka, and Cantonese are syncretic languages derived from both Han and Nanman cultures, and a huge portion of southern China's population (including the Miao, Zhuang, Yi, and Tanka boat people) have Nanman blood.