[2][3] By 819, during the reign of Emperor Xianzong, when Tian Hongzheng was serving as military governor and was following imperial orders in attacking the warlord Li Shidao, who ruled Pinglu Circuit (平盧, headquartered in modern Tai'an, Shandong),[4] Shi Xiancheng served as Tian's forward commander in leading 4,000 soldiers across the Yellow River to attack Pinglu.
[4] As a result of Shi's contributions, he was given the honorary title of deputy chief imperial censor (御史中丞, Yushi Zhongcheng).
In winter 821, Tian Bu launched his 30,000 troops to attack Wang, capturing two Chengde outposts just south of Nangong (南宮, in modern Xingtai, Hebei).
However, as recounted in a petition from Bai Juyi to Emperor Muzong at the time, he then became bogged down because his soldiers, who had been accustomed to rich rewards from the imperial government, lost their motivation.
In spring 822, when there was an imperial order for some Weibo soldiers to report to the camp of Li Guangyan the military governor of Zhongwu Circuit (忠武, headquartered in modern Xuchang, Henan) to attack Chengde from the east, the Weibo soldiers largely deserted Tian and fled to Shi's camp.
He saw the hopelessness of the situation he was in, and he wrote a final petition to Emperor Muzong and entrusting it to his staff member Li Shi (who would eventually be chancellor) and then committed suicide.
Shi, upon hearing of Tian Bu's death, returned to Weibo's capital Wei Prefecture (魏州) and was subsequently supported by the soldiers to serve as acting military governor.
Fearful that Wei would suggest to Emperor Wenzong that imperial troops act against him, Shi did not dare to aid LI Tongjie.
The soldiers, angry at him and fearful that he had effectively sold them out to the imperial government, mutinied and killed him under the leadership of He Jintao.
Emperor Wenzong was forced to acknowledge He as military governor and further return the three prefectures originally given to Shi Xiaozhang.