In 881, Huang Chao moved into the Tang palace in
Chang'an and declared himself the emperor of a new state of Qi. He made his wife,
Lady Cao, empress, while making Shang Rang, Zhao Zhang (), and the Tang officials Cui Qiu () and Yang Xigu () chancellors. Huang initially tried to simply take over the Tang imperial mandate, as he ordered that the Tang imperial officials of the fourth rank or lower (in Tang's nine-rank system) continue to remain in office, as long as they showed submission by registering with Zhao, removing only the third-rank or above officials. The Tang officials who would not submit were executed en masse. Huang also tried to persuade Tang generals throughout the circuits to submit to him, and a good number of them did, including Zhuge Shuang () (whom he made the military governor of Heyang Circuit (河陽, headquartered in modern
Jiaozuo,
Henan)),
Wang Jingwu the military governor of Pinglu Circuit (平盧, headquartered in modern
Weifang, Shandong),
Wang Chongrong (whom he made the military governor of Hezhong Circuit (河中, headquartered in modern
Yuncheng, Shanxi), and Zhou Ji (whom he made the military governor of Zhongwu Circuit) — although each of those generals eventually redeclared loyalty to Tang and disavowed Qi allegiances. He also tried to persuade the former Tang chancellor
Zheng Tian, the military governor of nearby Fengxiang Circuit (鳳翔, headquartered in modern
Baoji, Shaanxi), to submit, but Zheng resisted, and when he sent Shang and Wang Bo () to try to capture Fengxiang, Zheng defeated Qi forces that he sent in spring 881. Tang forces were still not making a true attempt to recapture Chang'an by this point. However, the ethnic
Shatuo general
Li Keyong — who had been a Tang renegade for years but who had recently resubmitted to Tang and offered to attack Qi on Tang's behalf, arrived at Tong Prefecture in winter 882 to join the other Tang forces. In spring 883, Li Keyong and the other Tang generals defeated a major Qi force (150,000 men) commanded by Shang and approached Chang'an. In summer 883, Li Keyong entered Chang'an, and Huang was unable to resist him, and so abandoned Chang'an to flee east. With Tang forces again boggled down in pillaging the city, they were unable to chase Huang, and Huang was able to flee east without being stopped. (However, according to an alternative account in the
New Book of Tang, Huang, believing that it was the only way that any of his army could be saved, committed suicide after instructing Lin to surrender with his head.)
Legend of possible escape Some speculate that Lin Yan bringing the alleged heads of Huang Chao and others to Shi Pu was only a decoy to allow the real Huang Chao to escape. It was noted that Langhu Valley was over 500
li or 3–4 days away on a horseback from Shi's camp in Xu Prefecture, and decomposition would have already kicked in during the hot summer to make the faces unrecognizable. Moreover, Huang Chao had a number of brothers following him and the siblings likely resembled each other. Legends popular during the ensuing
Five Dynasties and Ten Kingdoms period claim that Huang became a
Buddhist monk following his escape. The
Song dynasty scholar Wang Mingqing (), for example, alleged in his book
Huizhu Lu: "When
Zhang Quanyi was the mayor (留守) of the Western Capital (i.e.
Luoyang), he recognized Huang Chao from among the monks." == Poetry ==