Emperor Wenzong of Tang

Liu initially tried to have Emperor Muzong's younger brother Li Wu the Prince of Jiàng (note different tone) made emperor, but soon, a group of powerful eunuchs—the directors of palace communications Wang Shoucheng and Yang Chenghe (楊承和) and commanders of the Shence Armies Wei Congjian (魏從簡) and Liang Shouqian (梁守謙) counteracted against the conspirators, launching forces to slaughter them.

Li Tongjie decided to resist militarily, and he was supported by the warlord Wang Tingcou, the military governor of neighboring Chengde Circuit (成德, headquartered in modern Shijiazhuang, Hebei).

Emperor Wenzong mobilized a number of circuits around Henghai to attack it, but could not immediately achieve success.

[9] In the aftermath of Li Tongjie's defeat, however, one of the other warlords of the region, Shi Xiancheng the military governor of Weibo Circuit (魏博, headquartered in modern Handan, Hebei), fearing that he would be the imperial forces' next target, offered to surrender his circuit to imperial control.

Emperor Wenzong transferred Shi to Hezhong Circuit (河中, headquartered in modern Yuncheng, Shanxi) and commissioned the imperial general Li Ting (李聽) to succeed him.

[9] 830 saw the start of factionalism, later known as the Niu-Li Factional Struggles, within Emperor Wenzong's administration—as, by this point, Wei Chuhou had died, and fellow chancellor Pei Du, in his old age, had taken less of a lead on government decisions (and was eventually sent out of the capital to serve as a military governor).

However, when Wang and his strategist Zheng Zhu later heard about the plot in 831, they counteracted by falsely accusing Song of planning to overthrow Emperor Wenzong and replace him with his brother Li Cou the Prince of Zhang.

Li Deyu advocated accepted Xidamou's surrender and further use it as a base to launch a major attack on Tufan.

Emperor Wenzong agreed and ordered Li Deyu to return Wei Prefecture to Tufan.

)[9] Also in 832, in the aftermaths of the Xidamou incident, with popular sentiment turning against Niu Sengru, Niu resigned his chancellor position to become the military governor of Wuchang Circuit (武昌, headquartered in modern Wuhan, Hubei), and Li Deyu was recalled to Chang'an, becoming chancellor in 833.

Li Zongmin himself was soon sent out of Chang'an to serve as the military governor of Shannan West Circuit (山南西道, headquartered in modern Hanzhong, Shaanxi).

When the chancellor Lu Sui tried to intercede for Li Deyu, he, too, was sent out of the capital to serve as the military governor of Zhenghai.

In winter 835, the plan was beginning to be put into motion, as Zheng was sent to Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi), to establish an army to use against the eunuchs.

When, subsequently, Wang Shoucheng was forced to commit suicide on Emperor Wenzong's orders, Emperor Wenzong, Li Xun, and Zheng planned to use Wang Shoucheng's funeral as an excuse to gather the eunuchs and then use Zheng's troops to slaughter them.

They subsequently launched the Shence Army soldiers and slaughtered and arrested a high number of officials, including Li Xun.

)[12] In the aftermaths of the incident, Emperor Wenzong became physically under the eunuchs' hold, and he, the new chancellors Li Shi and Zheng Tan, and the other imperial officials, had their authorities severely reduced.

[11] In spring 836, the warlord Liu Congjian the military governor of Zhaoyi Circuit (昭義, headquartered in modern Changzhi, Shanxi), submitted harshly-worded petitions accusing Qiu Shiliang and the other eunuchs of crimes.

It was said that only after Liu's petitions that Qiu and the other eunuchs became apprehensive and allowed Emperor Wenzong, Li Shi, and Zheng Tan some ability to govern based on their own will.

Soon, partisanship again flared among the chancellors, pitting Zheng and Chen, both of whom were considered Li Faction leaders, against Yang and Li Jue, both of whom were considered Niu Faction leader, and it was said that the chancellors' advice became motivated by partisan considerations, making it difficult for Emperor Wenzong to rule on them, until Zheng and Chen were removed in 839.

[13] Emperor Wenzong issued an imperial decree, stating Li Bai's poetry, Zhang Xu's calligraphy and Pei Min's swordplay as the "Three Wonders of the Great Tang Empire".

[16] In 837, a project commissioned by Emperor Wenzong, to have the texts and commentaries of the Confucian classics carved on stone tablets and publicly displayed, was completed at the imperial university for nobles (國子監, Guozi Jian).