Ordos Plateau
In Chinese accounts, the Xiongnu first appear at Ordos in the "Yizhoushu" and "Shanhaijing" during the Warring States period before it was occupied by Qin and Zhao. It is generally thought to be their homeland, however when exactly they came to occupy the region is unclear, and it might have been much earlier than traditionally thought, as suggested by archaeological finds. As the Xiongnu expanded southward into Yuezhi territory around 160 BC under their leader Modun, the Yuezhi in turn defeated the Sakas (Scythians) and pushed them away at the Issyk Kul. It is thought the Xiongnu also occupied the Ordos area during the same period, when they came in direct contact with the Chinese. From there, the Xiongnu conducted numerous devastating raids into Chinese territory (167, 158, 142, 129 BC). The Han Dynasty started to fight the Xiongnu in the 2nd century BC under emperor Han Wudi, and colonized the area of the Ordos under Shuofang commandery in 127 BC. Prior to the campaign, there were already commanderies established earlier by Qin and Zhao until they were overrun by the Xiongnu in 209 BC.
Han–Xiongnu War
During the Warring States period, the Qin, Zhao, and Yan states conquered various nomadic territories inhabited by the Xiongnu and other Hu peoples. They strengthen their new frontiers with elongated wall fortifications. By 221 BC, the Qin ended the chaotic Eastern Zhou period by conquering all other states and unifying the entire nation. In 215 BC, Qin Shi Huang ordered General Meng Tian to set out against the Xiongnu tribes, situated in the Ordos region, and establish a frontier region at the Ordos Loop. Believing that the Xiongnu were a possible threat, the emperor launched a pre-emptive strike against the Xiongnu with the intention to expand his empire. Later that year (215 BC), General Meng Tian succeeded in defeating the Xiongnu and driving them from the Ordos region, seizing their territory as result. After the catastrophic defeat at the hands of Meng, Touman Chanyu and his followers fled far into the Mongolian Plateau. Fusu (Prince of Qin) and General Meng Tian were stationed at a garrison in Suide and soon began with the construction of the walled defenses, connecting it with the old walls built by Qin, Yan and Zhao states. The fortified walls ran from Liaodong to Lintao, thus enclosing the conquered Ordos region, safeguarding the Qin empire against the Xiongnu and other northern nomadic people. Due to the northward expansion, the threat that the Qin empire posed to the Xiongnu ultimately led to the state formation of the many tribes towards a confederacy.