In 645, Taizong of Tang had a north march in Jiming Mountain () during his campaign against Xueyantuo. In 822, Tang established Longmen County () and Huai'an County (), thus the first appearance of Huai’an. In 866. Tang established Xinzhou (), the administrative center located to the west of Zhuolu. In 877, Li Keyong, the grandfather of Li Cunxu, later the emperor of Later Tang, was serving as the deputy commander of the Shatuo troops and stationed in Yuzhou, turning this place into his base for future struggles. In 899, Wuzhou () was established with its administrative center in Xuanhua. Meanwhile, Wende County () was established, the administrative center in present Xuanhua.