Gao Pian made Li Hanzhi an officer in his army, and later commissioned as the prefect of Guang Prefecture (光州, in modern
Xinyang,
Henan). At a later point, when
Qin Zongquan the military governor of Fengguo Circuit (奉國, headquartered in modern
Zhumadian,
Henan) rebelled against Tang and seized nearby territory, Li was pressured by the Fengguo army and abandoned Guang Prefecture. He returned home to Xiangcheng and gathered his forces there, and submitted to
Zhuge Shuang the military governor of Heyang Circuit (河陽, headquartered in modern
Jiaozuo,
Henan). Zhuge made him the prefect of Huai Prefecture (懷州, in modern
Luoyang,
Henan). Subsequently, when Emperor Xizong commissioned Zhuge as one of the commanders of the forces against Qin, Zhuge commissioned Li as his deputy, as well as the defender of the Tang eastern capital
Luoyang. As Luoyang had been laid waste by the wars by that point, Li made Shengshan Temple () his headquarters. Meanwhile, when
Li Keyong, the ethnically
Shatuo military governor of Hedong Circuit (河東, headquartered in modern
Taiyuan,
Shanxi), went through Luoyang on the way back to Hedong after a campaign against Huang, Li welcomed him and formed a friendship with him. In 886, Zhuge died, and initially the officers Liu Jing () and
Zhang Quanyi supported Zhuge's son Zhuge Zhongfang () as the acting military governor, but Liu held the actual authorities. He feared that Li would not easily be controllable, so he entered Luoyang himself and attacked Li at Mianchi. Li defeated him and slaughtered most of his army. Li then prepared to give chase across the
Yellow River (as Heyang's capital, the city of Heyang, was just north of the Yellow River). Liu sent Zhang to resist Li, but by this point, Zhang was also alienated by Liu's domination of the circuit, and then instead joined Li in attacking Heyang. They were, however, defeated by Liu, and withdrew to Huai Prefecture. == Loss of Heyang Circuit ==