Emperor Xizong of Tang

Emperor Xizong of Tang (June 8, 862 – April 20, 888), né Li Yan, later name changed to Li Xuan (, changed 873), was an emperor of China's Tang dynasty. He reigned from 873 to 888. He was the fifth son of his predecessor Emperor Yizong and was the elder brother of his successor Emperor Zhaozong. His reign saw his realm overrun by the great agrarian rebellions led by Wang Xianzhi and Huang Chao, and while both were eventually defeated, by the end of Emperor Xizong's reign, the Tang state had virtually disintegrated into pieces ruled by individual warlords, rather than the imperial government, and would never recover, falling eventually in 907.

Background and accession
Li Yan was born on June 8, 862, at the eastern palace in the Tang imperial capital Chang'an, as the fifth son of then-reigning Emperor Yizong. His mother was Emperor Yizong's concubine Consort Wang, who carried the title of Guifei, the highest rank carried by imperial consorts. In 865, Li Yan was created the Prince of Pu; at that time, his older brother Li Kan (李侃) was created the Prince of Ying. Consort Wang died a year later, in 866. As he was growing up, one of his constant companions was the eunuch Tian Lingzi, who attended to the stables at his mansion.

In 873, Emperor Yizong became seriously ill. The eunuch commanders of the imperial Shence Armies, Liu Xingshen (劉行深) and Han Wenyue (韓文約), despite the fact that Li Yan was one of the younger sons of Emperor Yizong, supported him as the successor. Thereafter, an edict was issued in Emperor Yizong's name, creating Li Yan Crown Prince. The edict also changed Li Yan's name to Li Xuan. Emperor Yizong died that day, and Li Xuan took the throne as Emperor Xizong, with his brother-in-law, the chancellor Wei Baoheng, serving as regent for several days. He posthumously honored his mother Consort Wang as empress dowager and created Liu and Han dukes.

Early reign: rebellions led by Wang Xianzhi and Huang Chao
Almost immediately thereafter, Wei Baoheng, who had been exceedingly powerful late in Emperor Yizong's reign, was exiled and later forced to commit suicide in exile. Meanwhile, Tian Lingzi became very influential, and was described as the actual decision-maker for most of the important decisions of state, as Emperor Xizong was young and trusting of him.

Early in Emperor Xizong's reign, a terrible drought-driven famine took over the heart of the Tang realm. As described by the imperial scholar Lu Xi, who would become chancellor in late 874:

"I personally saw the devastation of the drought last year. As far west at Guo Prefecture [(虢州, in modern Sanmenxia, Henan)] and as far as the Great Sea [(i.e., the East China Sea)], the spring wheat only yielded half as much as it should; the various food crops of the fall yielded very little, and even less of an yield did the winter vegetables have. The poor people ground the seeds of the spatterdock into powder, and ate it with the leaves of the pagoda tree as they were vegetables. Some people suffered even worse, indescribable fates. For several years now, year by year there were poor harvests, and the people fled to other prefectures, leaving just the helpless people with nowhere to go, sitting in the ruins of their villages awaiting starvation."

Lu urged that Emperor Xizong waive all taxation on the prefectures affected by the famine and immediately start disaster relief efforts. Emperor Xizong issued an edict agreeing with Lu's suggestions, but it was said that no actual disaster relief was actually carried out. Meanwhile, the southwestern regions of the empire, largely unaffected by the famine, was instead embroiled in the wars with Dali.

As the famine continued, the people who were displaced by the famine began to lose hope in the imperial government, and they gathered in roving bands, pillaging for food. By 874–875, a large group had gathered under the leadership of Wang Xianzhi and Huang Chao. Within a few months, Wang and Huang had gathered tens of thousands of men in their army. Meanwhile, the army officer Wang Ying also rebelled and led his band of rebels to pillage the southeast coast. There were numerous smaller bands of rebels roving around the realm.

The imperial administration tried to deal with the Wang/Huang rebellion by initially having the military governors (jiedushi) of the five most-affected circuits—Huainan (淮南, headquartered in modern Yangzhou, Jiangsu), Zhongwu (忠武, headquartered in modern Xuchang, Henan), Xuanwu (宣武, headquartered in modern Kaifeng, Henan), Yicheng (義成, headquartered in modern Anyang, Henan), and Tianping (天平, headquartered in modern Tai'an, Shandong) mobilize their local troops to either destroy the rebels or encourage them to surrender. This strategy was ineffective, and at the suggestion of Song Wei (宋威) the military governor of Pinglu Circuit (平盧, headquartered in modern Weifang, Shandong), Emperor Xizong put Song in command of a special task force concentrating on eliminating the rebels. Song had some early successes, but soon showed himself to be unable to follow up on his successes, as he was unable to contain Wang's roving army. In late 876, the chancellor Wang Duo tried to end Wang Xianzhi's rebellion by promising to make him an army officer—an offer that Wang Xianzhi was initially entice by—but after Huang opposed the proposal, the war continued, with Wang Xianzhi and Huang dividing their armies into two separate bands.

However, Wang Xianzhi again made a peace overture in 877, sending his deputy Shang Junzhang (尚君長) to meet the eunuch general Yang Fuguang to negotiate a surrender. However, Song, who opposed a peace with Wang, captured Shang as Shang was on his way to meet with Yang, and falsely claimed that he had claimed Shang in battle. He delivered Shang to Chang'an to be executed, despite Yang's repeated attempts to have Shang spared. Shang's death ended hopes for a negotiated peace. (Meanwhile, though, Wang Ying's rebellion ended when he was killed in battle.)

Soon thereafter, Song was relieved of his command of the task force, and Zeng Yuanyu (曾元裕) took over. Zeng soon defeated Wang Xianzhi in battle and killed him. However, Wang's followers, including Shang Junzhang's brother Shang Rang, gathered their troops and submitted to Huang. Huang continued the roving campaign, and marched south, capturing and for some time holding Guang Prefecture (廣州, in modern Guangzhou, Guangdong) as his headquarters. Meanwhile, the Shatuo chieftain Li Guochang and Li Guochang's son Li Keyong rebelled to the north, and they made an attempt to take over the modern Shanxi region, but soon they were defeated and forced to flee to the Dada (達靼, then in the Yin Mountains) tribe.

Fall of Chang'an to Huang Chao and flight to Chengdu
By winter 879, Huang Chao, with his soldiers stricken by tropical/subtropical illnesses that they were not accustomed to, decided to change strategy and head north. He headed north through modern Hunan preparing to confront the armies commanded by Wang Duo, who was then in overall command of the operation against him. He first defeated Wang's deputy Li Xi (李係) at Tan Prefecture (in modern Changsha, Hunan); Wang, then stationed at Jiangling, panicked and fled, and Wang's officer Liu Hanhong pillaged Jiangling then became an independent rebel leader. Huang's advance, however, was repelled by other Tang generals Liu Jurong (劉巨容) and Cao Quanzhen (曹全晸) at Jingmen (荊門, in modern Jingmen, Hubei). Huang was forced to flee east, but he regrouped in the modern Jiangxi region and prepared for another advance north.

As Huang did so, he had multiple engagements with the armies under the command of Gao Pian the military governor of Huainan Circuit, whom Emperor Xizong had put in command of the overall operations against Huang, replacing Wang. Gao's officer Zhang Lin (張璘) had initial successes against Huang, but Huang killed Zhang in a major confrontation in summer 880. Gao's spirit was crushed by Zhang's death, and he did not try to stop Huang's subsequent advance north, across the Yangtze River into the heart of the Tang realm. Emperor Xizong, as an emergency measure, ordered the armies of various circuits to rendezvous with Cao at Yin River (溵水, a major branch of the Shaying River) to try to block of Huang's advance. However, Huang defeated Cao, and after a mutiny at nearby Zhongwu Circuit caused the death of the military governor of Zhongwu, Xue Neng (薛能), Qi Kerang, the Tang general in command of the Yin River defense, abandoned the defensive position, causing Huang's path toward the Tang eastern capital Luoyang to become wide open.

In light of his obstacle being removed, Huang headed straight for Luoyang; on the way, he stopped pillaging other than to force young men into his army and adding to its numbers. Luoyang quickly fell and was captured on 22 December 880. Emperor Xizong and Tian Lingzi conscripted a new army and put Zhang Chengfan (張承範) in charge of it, having him rendezvous with Qi at Tong Pass to defend against Huang's advance toward Chang'an. However, Emperor Xizong and Tian were instead making plans to flee to Xichuan Circuit (西川, headquartered in modern Chengdu, Sichuan), where Tian's brother Chen Jingxuan was military governor. As soon as news arrived that Huang had defeated Zhang and Qi and was advancing quickly toward Chang'an, Emperor Xizong and Tian abandoned Chang'an and fled toward Chengdu, arriving there in early 881. Huang entered Chang'an and declared himself the emperor of a new state of Qi. He slaughtered members of the Tang imperial family and a large number of high level officials, but tried to keep the Tang governmental apparatus in place for some time, hoping to get Tang generals and officials to switch loyalty.

After Chang'an's fall, a number of Tang military governors, including Zheng Tian, Wang Chongrong, Wang Chucun, Tuoba Sigong, Cheng Zongchu (程宗楚), and Tang Hongfu (唐弘夫), rendezvoused near Chang'an and then attacked Chang'an, hoping to recapture it for Emperor Xizong. In summer 881, Huang briefly abandoned Chang'an, but as soon as he realized that the Tang forces entering Chang'an were intent on pillaging it, he counterattacked and inflicted great losses on the Tang forces, forcing them to abandon Chang'an again and killing Cheng and Tang Hongfu. For the next several years, he would not again be dislodged from Chang'an despite Tang forces' efforts, and Emperor Xizong himself made no real efforts in trying to organize imperial troops to do so. With Gao not making any efforts to dislodge Huang, either, Emperor Xizong put Wang Duo in overall command of the effort against Huang again.

Destruction of Huang Chao and return to Chang'an
As the Tang and Huang Chao's Qi forces battled around Chang'an, the rest of the Tang realm, while mostly still ostensibly loyal to Emperor Xizong and obeying his edicts issued from Chengdu, began to break down further in its governmental/command structure. For example, Gao Pian's Huainan Circuit, regarded as one of the riches of the Tang realm, fell into years of internecine warfare (which included Gao's death at the hands of Qin Yan) with Yang Xingmi eventually emerging victorious but with the circuit laid waste.

Meanwhile, Yang Fuguang enlisted Li Keyong, who had previously fled to the Dada tribes, to return to Tang realm to help battle Qi, offering to pardon him. Li Keyong did so in 882, and repeatedly defeated Qi forces. In spring 883, Huang abandoned Chang'an and fled back east, allowing Tang forces to recapture Chang'an. Huang's forces then were continued to be defeated by Tang generals Li Keyong, Zhu Quanzhong, and Shi Pu, eventually falling apart. In fall 884, Huang's nephew Lin Yan (林言) killed Huang, ending Huang's Qi state.

Emperor Xizong did not return to Chang'an, immediately, apparently fearing Qin Zongquan—formerly a Tang military governor of Fengguo Circuit (奉國, headquartered in modern Zhumadian, Henan) but who had turned against Tang and was pillaging the modern Henan region with his power base centered at Fengguo's capital Cai Prefecture. Qin, indeed, would subsequently declare himself emperor and try to expand the extent of his control, causing him to battle with Zhu and other Tang generals. Meanwhile, the breakdown of the Tang realm continued, with Tang military governors battling each other for supremacy, and one of the key rivalries that developed was that between Zhu (who was made the military governor of Xuanwu Circuit) and Li Keyong (who was made the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), which began over a failed attempt by Zhu to assassinate Li Keyong.  Emperor Xizong did return to Chang'an in spring 885, some two years after Tang forces recaptured the capital.

Second flight from Chang'an and final days
Soon after Emperor Xizong's return to Chang'an, however, a serious dispute developed between Tian Lingzi, who was still largely in control of the imperial court, and Wang Chongrong, then the military governor of Huguo Circuit (護國, headquartered in modern Yuncheng, Shanxi). The dispute stemmed from the desperate financial situation that the imperial government was in by this point—with only Chang'an and the immediately surrounding region under the imperial government's control and submitting taxes to it (and the other circuits withholding their usual tax submissions to the imperial government, the imperial government was unable to pay the salaries of the army that Tian had amassed, which included the Shence Armies and personal armies that Tian himself had recruited). Tian tried to partially solve the problem by ordering Wang to return control of salt ponds at Huguo Circuit, previously under imperial control, to the imperial government, so that its proceeds could be used to pay imperial armies. Wang refused and spoke against Tian publicly. Tian, in retaliation, had Emperor Xizong order that Wang be transferred to Tianping Circuit. Wang refused the transfer and, allied with Li Keyong, prepared for a confrontation with the imperial armies under Tian, as well as Tian's allies Zhu Mei the military governor of Jingnan Circuit (靜難, headquartered in modern Xianyang, Shaanxi) and Li Changfu the military governor of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shanxi). Around new year 886, they defeated Tian and his allies and approached Chang'an. Tian took Emperor Xizong and fled to Xingyuan (興元, in modern Hanzhong, Shanxi).

Zhu and Li Changfu subsequently turned against Emperor Xizong and declared his distant relative Li Yun the Prince of Xiang emperor at Chang'an, and initially it appeared that military governors were ready to recognize Li Yun as emperor instead. Faced with a situation he could not handle, Tian resigned his position as the commander of the Shence Armies and fled to Xichuan to join his brother Chen Jingxuan. Tian was succeeded by Yang Fugong (the brother of Yang Fuguang, who was deceased by this point). Yang Fugong, utilizing the friendships that Yang Fuguang had with Wang Chongrong and Li Keyong, was able to persuade them to again recognize and support Emperor Xizong. Subsequently, Zhu's subordinate Wang Xingyu assassinated him and forced Li Yun to flee to Huguo, where Wang Chongrong killed him, ending his challenge to Emperor Xizong. Subsequently, Emperor Xizong's general Li Maozhen defeated Li Changfu and took over Fengxiang. Emperor Xizong himself returned to Chang'an in spring 888.

One month after Emperor Xizong returned to Chang'an, he died of illness. Yang Fugong supported his younger brother Li Jie the Prince of Shou to be emperor (as Emperor Zhaozong).

Chancellors during reign

 * Wei Baoheng (873)
 * Liu Ye (873–874)
 * Zhao Yin (873–874)
 * Xiao Fang (873–875)
 * Pei Tan (874)
 * Liu Zhan (874)
 * Cui Yanzhao (874–877)
 * Zheng Tian (874–878, 882–883)
 * Lu Xi (874–878, 879–880)
 * Li Wei (875–878)
 * Wang Duo (877–879, 881–882)
 * Doulu Zhuan (878–880)
 * Cui Hang (878–880)
 * Zheng Congdang (878–880, 883–887)
 * Wang Hui (880–881)
 * Pei Che (880–881, 883–887)
 * Xiao Gou (881–887)
 * Wei Zhaodu (881–888)
 * Kong Wei (886–888)
 * Du Rangneng (886–888)
 * Zhang Jun (887–888)

Family
Issue:
 * Li Zhen, Prince Jian (建王 李震), first son
 * Li Sheng, Prince Yi (益王 李升), second son
 * Princess Tangxing (唐興公主), first daughter
 * Princess Yongping (永平公主), second daughter