During Spring and Autumn period, Xiongnu and Donghu people inhabited the northern area while Yan State (since around 11th century BC) and Dai state (since 7th century BC) occupied the southern area. In 475 BC, Dai was occupied by Zhao Wuxu of Zhao State. In 300 BC, King Wuling of Zhao established Dai Commandery, managing the area of ancient Dai state with its administrative center in Dai, currently Daiwangcheng, Yu County. During the same period of time, King Zhao of Yan sent General Qin Kai who was once captured by Donghu people and thus became familiar with their tactics to defeat Donghu. Following that, Yan State built Great Wall in its border extending from Zaoyang (currently northeast of Xuanhua) to Xiangping (currently north of Liaoyang). In 283 BC, King Zhao established Shanggu Commandery. In 265 BC, Li Mu, a famous general of Zhao, commanded and deployed troops in Dai to protect against Xiongnu. After arriving in Dai, initially Li Mu banned any counterattack against Xiongnu to preserve the strength for years, which however incurred the discontent of King of Zhao. As a result, Li Mu was sacked. Following Zhao troops' defeat later, King of Zhao reinistated Li Mu. Viewing Zhao troops as cowards, Xiongnu grew arrogant and underestimated Zhao's strength. Finally, Li Mu led troops and ambushed Xiongnu, causing hundreds of thousands of casualties and great damage of Xiongu, thus ensuring decades of peace in Zhao's borderlands.