Han dynasty
To the north of China proper, the nomadic Xiongnu chieftain Modu Chanyu (r. 209–174 BC) conquered various tribes inhabiting the eastern portion of the Eurasian Steppe. By the end of his reign, he controlled Manchuria, Mongolia, and the Tarim Basin, subjugating over twenty states east of Samarkand. Emperor Gaozu was troubled about the abundant Han-manufactured iron weapons traded to the Xiongnu along the northern borders, and he established a trade embargo against the group. In retaliation, the Xiongnu invaded what is now Shanxi province, where they defeated the Han forces at Baideng in 200 BC. After negotiations, the "heqin" agreement in 198 BC nominally held the leaders of the Xiongnu and the Han as equal partners in a royal marriage alliance, but the Han were forced to send large amounts of tribute items such as silk clothes, food, and wine to the Xiongnu.
Han–Xiongnu War
During the spring of 123 BC, General Wei Qing set off to Mongolia with an army to attack the Xiongnu; they marched back victorious to Dingxiang. Two months later, the Han army advanced towards the Xiongnu again, but this time the Xiongnu were prepared for the invasion by the Han forces. However, hereafter, due to the military expeditions that the Han empire undertook, the Xiongnu moved their capital and retreated to the far northern regions of the Gobi Desert.