the Tang cause and sent forces to aid in the operations against Huang. After Huang was defeated and Emperor Xizong returned to Chang'an, Zhang was made the deputy minister of census (戶部侍郎, Hubu Shilang). In 887, he was made the deputy minister of defense (兵部侍郎, Bingbu Shilang) and chancellor de facto with the designation Tong Zhongshu Menxia Pingzhangshi (). (When the edict announcing this commission reached the warlord Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), Li Keyong, who was unimpressed with Zhang, stated, "Lord Zhang likes to talk but has no real abilities, and he is someone who can overturn the empire. The emperor decided to use him because of his reputation, but one day he will surely disturb the empire." After Zhang heard of these remarks, he bore a grudge against Li Keyong.) Chancellorship Zhang Jun continued to serve as chancellor after Emperor Xizong died in 888 and was succeeded by his brother Emperor Zhaozong, who was supported by Yang Fugong. However, after Emperor Zhaozong became emperor, both Zhang and fellow chancellor Kong Wei advocated a suppression of eunuch power. Emperor Zhaozong agreed, and, as he knew that Yang resented Zhang, trusted Zhang further with his plans of suppressing Yang's power. Zhang often compared himself to the great Jin Dynasty (266–420) Xie An and the great Tang chancellor Pei Du. Further, under Zhang's advocacy that the imperial government needed an army of its own, Emperor Zhaozong created an imperial army drawn from the people from Chang'an region, of some 100,000 strong. In 890, after Li Keyong failed in his campaign to attack Helian Duo the defender of Yun Prefecture (雲州, in modern Datong, Shanxi), Helian, Li Keyong's main rival Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan), and Li Kuangwei the military governor of Lulong Circuit (盧龍, headquartered in modern Beijing), all submitted petitions to Emperor Zhaozong asking him to declare Li Keyong a renegade and declare a general campaign against Li Keyong. When Emperor Zhaozong requested opinions from imperial officials, most opposed, including the chancellors Du Rangneng and Liu Chongwang, but Zhang and Kong, who wanted to try to use this as an opportunity to reassert imperial power, advocated for the campaign against Li Keyong and to then use that power to suppress the eunuchs, strenuously advocated for the campaign. Emperor Zhaozong, despite misgivings, agreed,