Also in 762, Emperor Suzong died and was succeeded by his son Emperor Daizong. In 763, when Tufan forces launched a surprise attack against Chang'an and forced Emperor Daizong to flee to Shan Prefecture (陝州, in modern Sanmenxia, Henan), Duan Xiushi persuaded Bai Xiaode to join the forces of the other circuits in aiding the emperor. Subsequently, Bai was made the military governor of Binning Circuit (邠寧, headquartered in modern Xianyang, Shaanxi), and Duan continued to serve as his deputy. At one time, when the circuit lacked food, Bai temporarily moved his army to Fengtian (奉天, also in modern Xianyang). However, Fengtian was then in a state of confusion as the local government had collapsed, and the soldiers, in response, were pillaging the area. Duan requested to serve as discipline officer as well, and subsequently, Duan imposed strict discipline on the army and stopped the pillaging. Upon the army's return to Binning's capital Bin Prefecture, Duan was created the Prince of Zhangye.