Hu (; IPA: ), or , was a rather vague umbrella term used in imperial China to describe non-Sinitic peoples, particularly steppe nomads from Inner Asia. The Hu were usually tribal confederations from the great grasslands of the Mongolian Plateau and the Western Regions, with a nomadic pastoralist lifestyle and a strong militant horse culture specializing in mounted archery and light cavalry warfare.

According to Hill (2009):

According to Nicola Di Cosmo, the Chinese considered the Hu as "a new type of foreigner" and "this term, whatever its origin, soon came to indicate an 'anthropological type' rather than a specific group or tribe, which the records allow us to identify as early steppe nomads. The Hu were the source of the introduction of cavalry in China".

History Historical records from Bronze Age Chinese dynasties such as the Shang and Zhou dynasty, the latter of which included the Spring and Autumn and Warring States periods, recounted numerous encounters with the non-Huaxia tribes beyond the authority of the Son of Heaven. At that time, the preferred term to designate non-Sinitic peoples, whom the ancient Chinese regarded as culturally backward and barbaric, was "Four Barbarians" (), each of which was named for a cardinal direction relatively to the Central Plains: the , , , and .Pulleyblank E. G. (1994) “Ji Hu: Indigenous Inhabitants of Shaanbei and Western Shanxi” in Edward H. Kaplan, ed., Opuscula Altaica: Essays presented in honor of Henry Schwarz. ed. by. Bellingham: Western Washington University. pp. 518-519 of 499-531

Xiongnu In the Qin state (before 221 BC), the term "Hu" came into designated usages to specifically describe the Xiongnu, who would be classified under the aforementioned Beidi concept. For example, the Xiongnu prince Jin Midi (134–86 BC), a naturalized prisoner of war later promoted as a confidant of Emperor Wu of Han, would be described as both a Hu person。in and a Yidi ().Ban Gu also uses the terms yidi to describe Jin Midi: "The nation of the barbarian Jin Midi was destroyed" in To the east of the Xiongnu were Proto-Mongol people known as the Donghu (; "Eastern Hu"), whose descendants became the Xianbei and Wuhuan after the Xiongnu destroyed their confederation.

Increasing raids, lootings and abduction of civilians for slavery by the Xiongnu was a primary reason for the construction of elongated defensive walls (precursors of the Great Wall of China) by various ancient Chinese states such as Yan, Zhao and Qin, which culminated in a Qin expeditionary campaign in 215 BC that dealt heavy blow to the Xiongnu in the Hetao region around the Yellow River's Ordos Loop. However, during the civil war after the Qin dynasty's collapse, the Xiongnu were united into a powerful nomadic empire under Modu Chanyu, who defeated and purged rival steppes confederacies (such as Donghu and Yuezhi, the latter being permanently evicted into Central Asia), and also occupied the Hetao region, thus becoming a prominent threat to the Guanzhong heartland during the early Western Han dynasty. This prompted Emperor Gaozu of Han to sortie against the Xiongnu at the Battle of Baideng, but he was ambushed and trapped and only escaped after bribing the chanyu's wife. The Han was then forced to pay the Xiongnu tribute for the next seven decades through so-called "marriage alliances", a situation that lasted until the reign of Emperor Wu, the seventh Han emperor, who successfully waged a war against the Xiongnu that tipped the geopolitical landscape in favor of the Han, allowing new trade routes (i.e. the Northern Silk Road) and power projection into the Western Regions via the Hexi Corridor, which were previously monopolized by the Xiongnu.

Subsequent Han emperors such as Emperor Xuan and Emperor Ming further capitalized on the strategic advantages gained under Emperor Wu and established the Protectorate of the Western Regions and later the Chief Official of the Western Regions, the latter of which lasted until two centuries after Han dynasty's collapse. The Han hegemony in Inner Asia led many of Xiongnu's prior vassals and tributary states in Central Asia to turn against them, coupled with attacks from resurgent old foes such as the Donghu, causing the Xiongnu to fall into civil wars and fragmentate into two, namely the Northern Xiongnu and Southern Xiongnu. The Southern Xiongnu later subjected to the Han Empire as a vassal, while the Northern Xiongnu remained hostile and was evicted further west from Central Asia in 151 CE, eventually disappearing from historical records, leading many historian scholars to suspect them as the ancestors of the Huns.

Zahu and Five Barbarians The fall of the Eastern Han dynasty during the turn of the 3rd century coincided with the disintegration of the Southern Xiongnu vassal state on the northern frontier. From then on, the Xiongnu identity gradually disappeared as their descendants were referred to as "Hu" instead. These miscellaneous Hu people (; záhú) were loosely grouped based on their shared geography or characteristics, such as the Lushuihu (; "Black River Hu") in northwestern China and Shanhu (; "Mountain Hu") in the mountainous regions of Shanxi. Many of these Hu intermingled among themselves and with tribes from other ethnic groups, eventually amalgamating into the Buluoji () or Jihu () that inhabited Shaanbei and western Shanxi by the 6th century CE. The Jihu disappeared by the late 7th century CE, presumably as they completed their assimilation into Chinese society.Tang, Changru (December 2010). " (in Chinese). Beijing: Commercial_Press. . Hu was also used in a broad sense to refer to the non-Han groups that inhabited northern China during the Jin dynasty (266–420 CE) and Sixteen Kingdoms period, which later gave rise to the term "Five Barbarians". While the term first appeared in an edict in 357 CE, the most popular interpretation of the Five Barbarians only came about in the 13th century, that is they represented the Xiongnu, Jie, Xianbei, Di and Qiang. The origins of the Jie is still unclear (most scholars suggest that they originated from Central Asia), but they likely arrived in China through the Southern Xiongnu. The Di and Qiang, both Tibeto-Burman peoples from the Tibetan Plateau and Hexi Corridor in the west, were typically not referred to as Hu during their time.

Many tribes of the Five Barbarians had settled into the northern frontiers and Guanzhong heartlands by the Western Jin period, and took advantage of the political chaos after the War of the Eight Princes to launch rebellions in northern China from 304 to 316, culminating in the Disaster of Yongjia in 311 CE where the Xiongnu Han-Zhao state captured and sacked the Jin capital Luoyang. This Upheaval of the Five Barbarians caused the surviving Jin royal court to relocate to Jiankang (modern-day Nanjing) on the south bank of the Yangtze River and establish the Eastern Jin dynasty. The Five Barbarians then established the Sixteen Kingdoms, among whom total wars and ethnic cleansings were frequent until they were finally all conquered and unified under the Northern Wei in 439 CE, beginning the Northern and Southern dynasties period.

The Rouran Khaganate, a multi-ethnic tribal confederation comprising primarily Xiongnu and Donghu, was founded in the Mongolian plateau in 330 CE. They were involved in royal intermarriages (heqin) with the Northern Yan, the Northern Wei dynasty and Wei's warring successors Eastern Wei and Western Wei, before being overthrown by the Göktürk First Turkic Khaganate in 555 CE.

Later, "Hu" was also used to include various groups of Iranic peoples from Central Asia who settled in China for trade, especially the Sogdians. The Tang dynasty conquered the Eastern Turkic Khaganate and defeated the Western Turkic Khaganate, creating a hegemony in Inner Asia with the establishment of the Protectorate General to Pacify the West. Central Asian trading caravans and tributary convoys became common, and Central Asian cultural practices that spread into Tang heartlands would then be qualified as "Hu", such as their dance the "Huteng" (, "barbarian hopping"), or the Huxuan (, "barbarian whirling", also , Húxuănwǔ, "barbarian whirling dance"), but known as "Sogdian Whirl dance" or simply "Sogdian whirl" to Western scholars.

Turkic peoples During the Sui and Tang dynasty, "Hu" also included Turkic peoples along the Silk Road such as Göktürks, Uyghurs and Shatuo, in addition to the Sogdians. Some of these Hu people had been sinicized so much that they became a significant part of Tang court politics, taking over prominent military and administrative roles such as fanzhen jiedushi, allowing them to become powerful warlords and oligarchs that the Tang relied upon heavily to manage other Hu threats.

The defection of the Turkic Karluk mercenaries were instrumental to the Abbasid Caliphate and the Tibetan Empire defeating the Tang at the Battle of Talas in 751, which subsequently led to the loss of Tang control over Transoxiana and most of the Western Regions. Two naturalized Sogdian warlords, An Lushan and Shi Siming, waged a massive rebellion in 755 that almost toppled the Tang dynasty. As a result, the heavily sinicized Shatuo people were instead entrusted to guard the Tang Empire's northern borders, and one such clan was even bestowed the surname Li as a token for their loyalty, with Li Keyong being rewarded heavily for his contribution defeating the Huang Chao Rebellion in 884.

After Tang dynasty's collapse in 907, three of the Five Dynasties that ruled over northern China (Later Tang, Later Jin and Later Han) were headed by Shatuo sovereigns, who by this point were so completely sinicized that they were no longer regarded as Hu people, rather as Han Chinese. The "Hu" name was instead given to the newly arrived nomads to the north, the Khitans.

Mongolics and Tungusic peoples The mountainous Sixteen Prefectures of Yan–Yun, which commanded the most important natural barriers that shielded the North China Plain from northerly invasions, were ceded to the Khitans in 938 by Later Jin founder Shi Jingtang in exchange of Khitan military aid in his selfish rebellion against his brother-in-law, Emperor Li Congke of Later Tang. The loss of this strategic region from Han Chinese control gave the Khitans a solid staging area for invading southwards, which proved decisive when the Khitan army under Yelü Deguang invaded and conquered the Later Jin in 947. In 958, Emperor Guo Rong of Later Zhou attempted to recapture the Sixteen Prefectures via a northern expedition while taking advantage of political chaos within the Khitan Liao dynasty, but despite many victories, his campaign had to be abandoned after he fell ill and died in 959.

After Later Zhou general Zhao Kuangyin usurped the throne of Guo Rong's 7-year-old heir Guo Zongxun to establish the Song dynasty in 960, he chose to wage war against the Ten Kingdoms to the south instead of continuing the late Guo Rong's northern campaign to reclaim the Sixteen Prefectures. However, by the time his brother and successor Zhao Guangyi finally decided to deal with the northern threat, the Khitans had already ended the two decades of infighting and stabilized politically. The Liao dynasty decisively defeated the Song dynasty's campaigns to recapture the Sixteen Prefectures twice in 979 and 986, but Liao's attempt to invade south was also defeated in 1004, resulting in the signing of the Chanyuan Treaty in 1005.