Yanmen Commandery was an administrative subdivision (jùn) of the state of Zhao established c. 300 BC and of northern imperial Chinese dynasties until AD 758.
[10][11] Garrisons and forts were also placed at strategic spots within the new territory, such as Yanmen Pass[3] between the northern plains and the Hutuo Valley.
[5][14] Its territory ran from present-day Shanxi's Hequ, Wuzhai, and Ningwu Counties in the south to Inner Mongolia's Huangqi and Dai Lakes in the north; its eastern border was near Mount Heng.
[14] It was part of the realm of Dai, used as an appanage of the imperial kings and a title of rebels like Han Xin and Chen Xi.
Under the Eastern Han, the commandery seat was moved to Yinguan, present-day Xiaguancheng Village[14] southeast of Shuozhou in Shanxi.
During China's Three Kingdoms period, Wei moved the commandery seat to Guangwu, southwest of present-day Daixian in Shanxi.
Under the Tang, Yanmen Commandery was part of Hedong Circuit until it was abolished and replaced by Dai Prefecture in 618, although it was temporarily restored between 742 and 758.