at the instigation of the chancellor Cui Zhaowei, marched on Chang'an to demand the deaths of the former chancellors Li Xi and Wei Zhaodu (and, when Emperor Zhaozong refused, put Li Xi and Wei to death themselves), Emperor Zhaozong wanted to find chancellors who were willing to stand up to the warlords. He thus summoned Zhang Jun, who was then no longer at Hua Prefecture but residing at his vacation estate in Changshui (長水, in modern Luoyang, Henan), and Kong Wei to the capital, initially giving them the honorary post of advisor to the Crown Prince Li Yu, Prince of De, and then making Kong chancellor, while making Zhang the minister of defense () and the director of circuit commerce. Li Keyong subsequently came to Emperor Zhaozong's defense, attacked and killed Wang Xingyu, but at Emperor Zhaozong's orders did not attack Li Maozhen or Han, as he had initially wanted to. In early 896, when Zhu Quanzhong submitted a petition recommending Zhang to be chancellor again, Li Keyong reacted by submitting a petition to ask for a campaign against Zhu, and further stating, "If Zhang Jun were made chancellor in the morning, I will arrive at the palace in the evening!" Emperor Zhaozong thus did not make Zhang chancellor. Later in 896, after Li Maozhen attacked Chang'an again (after a failed campaign by Emperor Zhaozong against him), Emperor Zhaozong fled to Hua Prefecture, and thereafter was under Han's control. Zhang, who followed Emperor Zhaozong to Hua Prefecture, was relieved of his post as the director of circuit commerce, and thereafter was made You Pushe (), one of the heads of the executive bureau (尚書省, Shangshu Sheng). He then sought retirement, and was allowed to retire with the higher title of Zuo Pushe (). He returned to Changshui. Second retirement Late in 900, the eunuchs Liu Jishu, Wang Zhongxian (), Wang Yanfan (), and Xue Qiwo (), in reaction to Emperor Zhaozong's killing several eunuchs and ladies in waiting in an alcohol-driven rage, forced him to abdicate to Li Yu. When this occurred, Zhang Jun went to meet Zhang Quanyi the military governor of Youguo Circuit (佑國, headquartered in modern Luoyang) to urge him to start a campaign to restore Emperor Zhaozong, and Zhang Jun further wrote to many circuit governors urging the same. (However, early in 901, the Shence Army officers Sun Dezhao (), Dong Yanbi (), and Zhou Chenghui