Before the Zhou Dynasty, it was a nomadic area such as the Guifang and Lin Hu. In the Warring States Period, it was the Yunzhong County of the Zhao State Territory, and later belonged to the Qin State. At the beginning of the Han Dynasty, it was the front line of the Xiongnu and Han wars. Emperor Wu of Han Dynasty set up the Shuofang County here. When Emperor Xuan of Han called the Huxie Chanyu to come, he became the residence of the Southern Xiongnu. Later, Hu Han lived in harmony, and the Uprising of the Five Barbarians broke out in the Western Jin Dynasty. Sixteen Kingdoms were the pre-Qin and post-Qin territory. The Northern Dynasties belonged to the Northern Wei Dynasty, the Western Wei Dynasty, and the Northern Zhou Dynasty. In the Sui and Tang Dynasties, they were all territories. In the Tang Dynasty, they were placed in the party, and the famous General Guo Ziyi once held this position. During the Anshi Rebellion, Emperor Suzong of Tang fled to this place.