 The Wei army was shocked at Zhong Hui's audacity.In response to the Wei invasion, the Shu government ordered its armed forces to refrain from engaging the enemy and instead retreat to Hancheng (漢城; east of present-day Mian County, Shaanxi) and Lecheng (樂城; east of present-day Chenggu County, Shaanxi) and hold their positions.Liu Qin (), the Administrator of the Wei-controlled Weixing Commandery (魏興郡; around present-day Ankang, Shaanxi), led his army through the Ziwu Valley (子午谷; east of present-day Yang County, Shaanxi) towards the Shu-controlled Hanzhong Commandery.