When Yan forces captured Tong Pass, Emperor Xuanzong and Yang, in panic, abandoned Chang'an and fled toward Shu Commandery (蜀郡, roughly modern Chengdu, Sichuan). On the way, at a small village, Mawei Station, prompted by general Chen Xuanli who believed that Yang Guozhong had provoked this rebellion, the imperial guards assassinated Yang Guozhong, and demanded the death of Yang Guifei, to which the Emperor reluctantly consented. An, caught by surprise of the Emperor's retreat, had Cui advance slowly into Chang'an, even though the Tang mayor of Chang'an, Cui Guangyuan (), offered to surrender. Also surrendering to Yan forces were the former chancellor Chen Xilie and the key officials Zhang Jun () and Zhang Ji (), and An made Chen and Zhang Ji chancellors as well.