On September 1, 1449, while retreating from the campaign against Mongols (Oirats), the 500,000-man army was defeated and the Emperor Yingzong of Ming was captured by chasing Mongolian troops in Huailai County, which was later called Tumu Crisis. The Emperor was sent back next year but only restored his throne in 1457. In 1529, local officer Zhang Zhen () built a small gate to north, which was strengthen in 1574 and 1581. Zhangjiakoubu enjoyed a paramount strategic position, thus being called Wuheng (). Therefore, Zhangjiakoubu was the origin and starting point of modern-day Zhangjiakou City.