Li Keyong

Li Keyong (October 24, 856 – February 23, 908) was a Shatuo military governor (Jiedushi) during the late Tang Dynasty and was key to developing a base of power for the Shatuo in what is today Shanxi Province in China. His son, Li Cunxu (Emperor Zhuangzong) would eventually became the founder of the Later Tang Dynasty, arguably the first of many Conquest Dynasties in China.

Background
Li Keyong — although he would have initially carried the surname of Zhuye — was born in 856, during the reign of Emperor Xuānzong. His father was the Shatuo chieftain Zhuye Chixin, whose people were then living in the Shenwu River (神武川, flowing through modern Shuozhou, Shanxi) region. His mother was Lady Qin, and it is not clear whether she was Zhuye Chixin's wife or concubine. He was Zhuye Chixin's third son.

In 869, during the reign of Emperor Xuānzong's son Emperor Yizong, as the Tang imperial general Kang Chengxun was commissioned to suppress the rebellion of Pang Xun at Xu Prefecture (徐州, in modern Xuzhou, Jiangsu), he invited Zhuye to bring his Shatuo soldiers and serve under him. Zhuye agreed, and then-14-year-old Li Keyong fought in the campaign so fiercely that he became known as the "Son of the Flying Tiger" (飛虎子). After the campaign, to recognize Zhuye Chixin's contributions during the campaign, Emperor Yizong bestowed on him the imperial surname of Li, and gave him a new name of Guochang. Li Keyong presumably took the imperial surname of Li at that time as well. Li Guochang was subsequently made the military governor (Jiedushi) of Zhenwu Circuit (振武, headquartered in modern Hohhot, Inner Mongolia). Li Keyong went to Zhenwu as well to serve under his father.

Initial rebellion against Tang Dynasty
As of 878, Li Keyong was serving as the deputy commander of the Shatuo troops at Datong Circuit (大同, headquartered in modern Datong, Shanxi) and stationed at Wei Prefecture (蔚州, in modern Zhangjiakou, Hebei). At that time, the commander of the Shatuo troops at Datong was Li Jinzhong (李盡忠), who, along with his officers Kang Junli (康君立), Xue Zhicheng (薛志誠), Cheng Huaixin (程懷信), and Li Cunzhang (李存璋), considered the Tang realm to be in such disarray due to agrarian rebellions (the chief of which was Huang Chao's rebellion), and Li Jinzhong wrote Li Keyong, encouraging him to overthrow the defender of Datong, Duan Wenchu (段文楚), who had drawn the ire of the soldiers by deducting their clothing and food stipends and being harsh in his enforcement of laws. Li Jinzhong then started a mutiny at Datong's capital Yun Prefecture (雲州), arresting Duan and his assistant Liu Hanzhang (柳漢璋). Li Keyong soon arrived, executed Duan and four of his subordinates, and claimed the title of defender of Datong. He sought imperial commission, but then-ruling Emperor Xizong refused.

Upon hearing of Li Keyong's mutiny, Li Guochang, then still the military governor of Zhenwu, initially submitted a petition to Emperor Xizong proclaiming his loyalty and asking Emperor Xizong to commission another defender of Datong — going as far as stating that if Li Keyong refused, he would be willing to attack Li Keyong himself. Instead, the imperial government requested that Li Guochang write a letter to Li Keyong to promptly receive the newly imperially-commissioned defender, Lu Jianfang (盧簡方). Believing that Li Keyong would nevertheless reject Lu, however, the imperial government changed tactics and named Li Guochang the new military governor of Datong, believing that Li Keyong would not resist his father.

However, Li Guochang was hoping that he and Li Keyong would be allowed to retain two circuits, and therefore, when he received the transfer order, he tore up the edict and rose in rebellion as well, joining forces with Li Keyong. Initially, their joint forces were successful, capture Zhelu Base (遮虜軍, in modern Xinzhou, Shanxi), and then defeating the joint forces of Cui Jikang (崔季康) the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi) and Li Jun (李均) the military governor of Zhaoyi Circuit (昭義, headquartered in modern Changzhi, Shanxi) at Hong Valley (洪谷, in modern Xinzhou), killing Li Jun in battle. (The defeat of the Hedong forces also appeared to lead to a chain reaction of several mutinies at Hedong, in which Cui was killed, and his successor Li Kan (李侃) resigned; after Li Kan's resignation and the natural death of his successor Li Wei, the subsequent successor Li Shao (李邵) was deposed, and Li Shao's successor Kang Chuangui (康傳圭) was killed.)

By summer 880, however, the tide began to change against Li Keyong and his Shatuo forces. As the newly-Tang-commissioned military governor of Datong, Li Zhuo (李涿), was joining forces with Li Keju the military governor of Lulong Circuit (盧龍, headquartered in modern Beijing) and the Tuyuhun chieftain Helian Duo against Li Keyong, Li Keyong left his officer Gao Wenji (高文集) in charge of his base at Shuo Prefecture (朔州, in modern Shuozhou, Shanxi) and stationed himself at Xiongwu Base (雄武軍, in modern Chengde, Hebei) to defend against Li Keju. Li Zhuo used this opportunity to entice Gao to surrender. Li Keyong tried to return to Shuo to recapture it, but was intercepted by Li Keju's officer Han Xuanshao (韓玄紹) and defeated, with Li Jinzhong and Cheng killed in battle. Meanwhile, Li Zhuo and Helian attacked Li Guochang at Wei Prefecture, defeating him. Both Li Guochang and Li Keyong were forced to abandon the region and flee to the Dada (達靼, then in the Yin Mountains region).

Helian was made the new defender of Datong, and he subsequently bribed the Dada chief, asking the Dada chief to put Li Guochang and Li Keyong to death. Li Keyong heard of this, but, pretending not to know about it, feasted with the Dada nobles. During the feast, he showed off his archery skills, such that he was even able to hit a leaf and a needle. He stated to the Dada nobles:

"I offended the Son of Heaven. I had long wanted to serve the empire, but now I cannot do so. I have heard, however, that Huang Chao had advanced north, and he will surely create disaster for the Central Plain.  If the Son of Heaven is willing to pardon me, I will surely advance south with you gentlemen to accomplish great things, to satisfy our desires.  There are not many years in a life, and I would not want to die old here in the desert."

After the Dada nobles heard of his declaration that he did not wish to remain long, they gave up on the plan to kill him.

Contributions in defeating Huang Chao and establishment at Hedong
By 881, Huang Chao had captured the imperial capital Chang'an, forcing Emperor Xizong to flee to Chengdu. Huang established a new state of Qi as its emperor. As part of the Tang operations against Huang's Qi state, the Shatuo generals Ju Zhen (瞿稹) and Li Youjin (李友金, a cousin of Li Guochang's) had gone to the Datong region to recruit soldiers for Tang, and while they were able to recruit some 30,000 soldiers, Ju and Li Youjin were having difficulty controlling them. Li Youjin then persuaded the eunuch monitor of the army in the region, Chen Jingsi (陳景思), to request Emperor Xizong to officially pardon Li Guochang and Li Keyong, so that he could ask them to join in the operation. Emperor Xizong did so, and Li Youjin subsequently went to Dada himself and brought Li Keyong back to Tang territory from Dada, along with 10,000 Dada soldiers.

In summer, Li Keyong advanced south through Hedong Circuit, and he wrote then-military governor of Hedong, Zheng Congdang, requesting that Zheng supply his troops. Zheng, while not openly hostile to Li Keyong, was suspicious of him, and therefore closed the gates of Hedong's capital Taiyuan Municipality and refused to provide Li Keyong with anything more than limited supplies. Li Keyong responded by pillaging the Taiyuan region. Zheng then sought and received aid from Qibi Zhang (契苾璋) the military governor of Zhenwu, who launched Tuyuhun and Tujue soldiers to repel the Shatuo. Li Keyong was forced to withdraw north. He captured Xin (忻州, in modern Xinzhou) and Dai (代州, in modern Xinzhou as well) Prefectures and made Dai his headquarters.

In spring 882, Li Keyong attacked Wei Prefecture. Qibi then requested imperial sanction and the cooperations of Datong and Tiande (天德, headquartered in modern Bayan Nur, Inner Mongolia) Circuits in operations against him. Emperor Xizong ordered Zheng to coordinate with Qibi. Meanwhile, Helian Duo and Li Keju engaged Li Keyong, but could not defeat him. Li Keyong also continued to pillage Hedong. Emperor Xizong had Wang Chucun the military governor of Yiwu Circuit (義武, headquartered in modern Baoding, Hebei), who was friendly with Li Keyong, write Li Keyong, informing him of imperial displeasure and suggesting that he cease his pillages and return to Shuo Prefecture.

Meanwhile, though, Tang forces were still not able to expel Huang from the Chang'an region. Yang Fuguang, the eunuch monitor of the army in the Hezhong (河中, headquartered in modern Yuncheng, Shanxi) region, suggested to Wang Chongrong the military governor of Hezhong that another attempt be made to invite Li Keyong to join the operations against Huang. At Yang's suggestion, the overall commander of the operations, the former chancellor Wang Duo wrote both Li Keyong and Zheng, summoning Li Keyong while requesting that Zheng allow Li Keyong's Shatuo troops passage through Hedong. In winter 882, Li Keyong passed through Hedong without further hostilities. He was given the title of military governor of Yanmen Circuit (雁門, i.e., the Datong region).

As Li Keyong arrived at Hezhong and prepared to cross the Yellow River to enter Huang's territory, Huang made an effort to befriend Li Keyong. As he knew that Li Keyong's brother Li Kerang had been previously killed by monks at a temple in the Qinling Mountains, he had Li Kerang's servant Hun Jintong (渾進通), who had submitted to Qi after Li Kerang's death, take an edict and many treasures from Huang to Li Keyong, and further delivered the monks responsible for Li Kerang's death to Li Keyong. Li Keyong executed the monks, but burned Huang's edict and distributed his treasure to the officers. He continued to advance into Huang's territory, stationing himself at Tong Prefecture (同州, in modern Weinan, Shaanxi) around the new year 883.

Li Keyong then continued his advance toward Chang'an, defeating Huang's brother Huang Kui (黃揆) on the way. He joined forces with those from Hezhong, Yiwu, and Zhongwu (忠武, headquartered in modern Xuchang, Henan) Circuits, and defeated the major Qi general Shang Rang. In summer 883, after he defeated Huang Chao near Chang'an, Huang Chao abandoned Chang'an and fled east. For his contributions, Emperor Xizong bestowed on him the honorary chancellor designation of Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事). It was said that while he was the youngest of the Tang generals who fought with Huang (26 at the time), he had the greatest accomplishments. As one of his eyes was smaller than the other (and might have been blind), he was referred to as the "One-Eyed Dragon" (獨眼龍).

After the victory at Chang'an, Li Keyong returned to Yanmen, but was soon commissioned the military governor of Hedong, replacing Zheng. Knowing that the people of Hedong were still fearful of him after past hostilities, he posted many declarations throughout Hedong, stating, "Do not worry about the past. Just be comfortable in what you do." His father Li Guochang was made the military governor of Daibei Circuit (i.e., the Yanmen region), replacing him.

After he started serving at Hedong, Li Keyong began to expand territory directly under his control. In late 883, Meng Fangli the military governor of Zhaoyi, whose power base was not at Zhaoyi's capital Lu Prefecture (潞州) and who found it difficult to control it, moved its capital to Xing Prefecture (邢州, in modern Xingtai, Hebei). The people of Lu were displeased. The eunuch monitor of Zhaoyi, Qi Shenhui (祁審誨) and the officer An Jushou (安居受) then secretly sought aid from Li Keyong. Li Keyong sent his cousin Li Kexiu (李克脩), who captured Lu and took it over. It was said that for the next several years, Li Keyong fought continuously for control of Zhaoyi's other prefectures, such that the circuit was laid to waste.

Henan campaigns and forming of enmity with Zhu Quanzhong
Meanwhile, although Huang Chao had withdrawn from the Chang'an region and fled east, he still had a powerful army. Threatened by Huang, three Tang military governors south of the Yellow River — Zhou Ji the military governor of Zhongwu, Shi Pu the military governor of Ganhua Circuit (感化, headquartered in modern Xuzhou), and Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) — jointly sought aid from Li Keyong. Li Keyong thus took 50,000 soldiers and advanced south to cross the Yellow River, but had to take a roundabout route through Hezhong when Zhuge Shuang the military governor of Heyang Circuit (河陽, headquartered in modern Luoyang, Henan) refused to grant him passage. He eventually rendezvoused with the armies of Zhongwu, Ganhua, Xuanwu, and Taining (泰寧, headquartered in modern Jining, Shandong) Circuits and headed toward Chen Prefecture (陳州, in modern Zhoukou, Henan), whose prefect Zhao Chou had been under siege by Huang for some 300 days. In summer 884, Li Keyong defeated Shang and then Huang Chao's brother Huang Siye (黃思鄴), and Huang Chao abandoned his siege on Chen.

Huang then headed toward Xuanwu's capital Bian Prefecture (汴州) and put it under siege. Zhu sought emergency aid from Li Keyong, and Li Keyong immediately headed toward Bian, catching Huang about to cross the Yellow River at Wangman Crossing (王滿渡, in modern Zhengzhou, Henan) and crushing his army. Shang surrendered to Shi, while a large number of Huang's other generals surrendered to Zhu. Li Keyong gave chase, and Huang fled to the east. During the chase, Huang's youngest son was captured by Li Keyong. Li Keyong's army became worn out during the chase, however, and he broke the chase and returned to Bian Prefecture.

After Li Keyong arrived at Bian, he initially offered to camp outside the city, but Zhu invited him to stay at the guest pavilion in the city and held a grand feast for him. At the feast, however, after Li Keyong became drunk, he used arrogant language that offended Zhu. Zhu and his officer Yang Yanhong (楊彥洪) then planned an ambush against Li Keyong. After the feast, Zhu had the mansion surrounded and attacked it. Li Keyong initially did not wake up, and his guards had to wake him up so that they could fight out of the siege. However, 300 of his attendants, including the officer Shi Jingsi (史敬思) and the eunuch monitor Chen Jingsi, were killed.

Before Li Keyong arrived at his camp outside the city, news of the ambush already reached Li Keyong's wife Lady Liu when one of Li Keyong's guards fled to the camp. Lady Liu, in order not to let the news prematurely leak, executed the guard and began to prepare for an orderly withdraw. After Li Keyong reached the camp, he planned an attack on Bian Prefecture. Lady Liu persuaded him not to, pointing out that if he did, the imperial government would not be able to tell who was in the right. Li Keyong agreed and withdrew. He sent a letter to Zhu condemning the attack. Zhu wrote back, apologizing, and blaming Yang (who was killed during the battle as well) for the attack. However, an enmity was formed between Li Keyong and Zhu that would last for the rest of their lives.

Subsequently, Li Keyong sought food supplies from Zhou, but Zhou refused, claiming to lack food himself. Li Keyong thus crossed the Yellow River north and returned to Hedong. He subsequently reorganized his army and submitted a harshly worded accusation against Zhu to the imperial government, seeking imperial sanction for a campaign against Zhu — offering to accept no imperial stipends if the imperial government would declare such a campaign. (At that time, Tang regulations were that a campaign waged at imperial behest would be supplied with imperial funds.) The imperial government, which had been severely weakened by Huang's rebellion, did not want to see two of the major warlords fighting against each other, and thus sent the major eunuch Yang Fuguang (Yang Fugong's brother) to try to calm Li Keyong, and Li Keyong abandoned the idea, but continued his resentment toward Zhu. The imperial government, apparently to sooth Li Keyong, subsequently allowed him to add Lin Prefecture (麟州, in modern Yulin, Shaanxi) to Hedong, and also made Li Kexiu the military governor of Zhaoyi — although, because Li Kexiu only controlled Lu Prefecture, Zhaoyi was effectively divided into two circuits, with Meng Fangli continuing to control the parts east of the Taihang Mountains. Emperor Xizong also created Li Keyong the Prince of Longxi, and also merged Datong Circuit back into Hedong.

Meanwhile, Li Keju and Wang Rong the military governor of Chengde Circuit (成德, headquartered in modern Shijiazhuang, Hebei) both feared Li Keyong's power and his alliance with Wang Chucun, who had married his nephew Wang Ye (王鄴) to Li Keyong's daughter. In spring 885, Li Keju and Wang Rong thus decided to attack Wang Chucun's Yiwu Circuit and divide it among themselves, while persuading Helian Duo to attack Li Keyong so he could not come to Wang Chucun's aid. Li Keyong nevertheless sent Kang Junli to aid Wang Chucun, and subsequently went to Wang Chucun's aid himself. He defeated Chengde forces at Wuji (無極, in modern Shijiazhuang), forcing them to withdraw. Meanwhile, while Lulong forces initially captured Yiwu's Yi Prefecture (易州, in modern Baoding), a counterattack by Wang Chucun recaptured it and forced Li Keju's officer Li Quanzhong, who commanded the Lulong forces, to retreat. (Li Quanzhong, fearing punishment from Li Keju, subsequently turned against him, attacked Lulong's capital You Prefecture (幽州), and forced Li Keju to commit suicide.)

The Li Yun Incident
Just as Li Keyong and Wang Chucun beat back the Chengde/Lulong attack, however, another crisis was developing. At that time, Emperor Xizong's court was dominated by the eunuch Tian Lingzi, who commanded the imperial Shence Armies. After Emperor Xizong's return to Chang'an in early 885, Tian and Wang Chongrun came into dispute over control of the salt ponds at Anyi (安邑) and Jie County (解縣, both in modern Yuncheng), which had previously been under the control of the imperial director of salt and iron monopolies, but which Wang Chongrong had taken over during the Huang Chao occupation of the Chang'an region. Tian wanted the control of the salt ponds given to the Shence Armies so that the Shence Armies could be paid using funds from selling the salt, while Wang Chongrong objected. The tension was further escalated when Tian sent his adoptive son Tian Kuangyou (田匡祐) as an emissary to Wang Chongrong's Hezhong Circuit, as Tian Kuangyou was overly arrogant and offended the soldiers. Wang Chongrong condemned Tian Kuangyou and Tian Lingzi publicly, and after Tian Kuangyou returned to Chang'an, he encouraged Tian Lingzi to act against Wang Chongrong.

Tian Lingzi reacted by having Emperor Xizong issue a series of transfer orders, transferring Wang Chongrong to Taining Circuit, Wang Chucun to Hezhong, and Qi Kerang the military governor of Taining to Yiwu. Emperor Xizong's orders included an order to Li Keyong that he escort Wang Chucun to Hezhong, despite Wang Chucun's objections that Wang Chongrong had great accomplishments in Huang's defeat and shold not be transferred, and that he himself needed to calm Yiwu after the recent Chengde/Lulong incursion. Meanwhile, Tian prepared for a campaign against Wang Chongrong by aligning with 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, Shaanxi).

Wang Chongrong sought aid from Li Keyong. Li Keyong initially indicated that he was preparing for a campaign against Zhu Quanzhong, and that he would come to Wang Chongrong's aid after defeating Zhu Quanzhong. Wang Chongrong pointed out that by that time, Wang Chongrong might have already been defeated, and instead advocated that Li Keyong and he destroy Tian first, and then Zhu Quanzhong. Li Keyong thus submitted a petition to Emperor Xizong condemning Zhu Mei and Li Changfu. Tian reacted by joining Zhu Mei and Li Changfu at Shayuan (沙苑, in modern Weinan), preparing to attack. Li Keyong then took his troops south and joined Wang Chongrong. Around the new year 886, Li Keyong and Wang Chongrong engaged the joint Shence/Jingnan/Fengxiang forces, crushing them. As Li Keyong then approached Chang'an, Tian took Emperor Xizong and fled to Fengxiang, and then Xingyuan (興元, in modern Hanzhong, Shaanxi). Zhu Mei and Li Changfu, ashamed of continued alliance with Tian, subsequently turned against him and sought peace with Li Keyong and Wang Chongrong, and Tian was forced to resign and flee to Chengdu to join his brother Chen Jingxuan the military governor of Xichuan Circuit (西川, headquartered in modern Chengdu). Zhu Mei, however, went a step further and declared Emperor Xizong's distant relative Li Yun the Prince of Xiang to be the new emperor. Meanwhile, Li Keyong returned to Hedong.

Li Yun's regime initially drew pledges of allegiance from such warlords as Gao Pian the military governor of Huainan Circuit (淮南, headquartered in modern Yangzhou, Jiangsu). Zhu Mei, however, wanted Li Keyong's cooperation as well, and therefore had Li Yun issue an edict to Li Keyong and also wrote Li Keyong himself, claiming that Emperor Xizong had already died and that Li Yun was the proper emperor. Li Keyong's strategist Gai Yu, pointing out that the people of the realm largely blamed Li Keyong for Emperor Xizong's flight from Chang'an and Li Yun's usurpation, argued for Li Keyong to refuse Li Yun's overtures. Li Keyong agreed, and therefore publicly announced continued loyalty to Emperor Xizong. When Li Keyong's declaration reached Xingyuan, it calmed the hearts of the officials at Xingyuan, who were fearful that Li Keyong would support Li Yun. Subsequently, when Zhu Mei's officer Wang Xingyu made no progress in attacking Emperor Xizong, he decided to turn against Zhu Mei; he returned to Chang'an, killed Zhu Mei, and forced Li Yun to flee to Wang Chongrong, who subsequently executed Li Yun, allowing Emperor Xizong to return to Chang'an. Meanwhile, two generals who had taken over the Heyang/Luoyang region from Zhuge Shuang's son and successor Zhuge Zhongfang (諸葛仲方), Zhang Quanyi and Li Hanzhi, sought aid from Li Keyong, as the region had recently been laid waste by Sun Ru. Li Keyong sent his officer An Jinjun (安金俊) to be the prefect of nearby Ze Prefectue (澤州, in modern Jincheng, Shanxi) with troops to aid Zhang and Li Hanzhi, allowing himself a foothold into the Heyang region. He also commissioned Li Hanzhi as the military governor of Heyang and Zhang as the mayor of Henan Municipality (河南, i.e., the Luoyang region). (By spring 888, however, Zhang had turned against Li Hanzhi, surprised him in battle, and taken over Heyang. When Li Hanzhi sought aid from Li Keyong, Zhang sought aid from Zhu Quanzhong, who repelled Li Keyong's attack; from that point on, Zhang became an ally and follower of Zhu's, while Li Hanzhi became a key general under Li Keyong.)

Expansion of power and confrontation with the imperial government
Also in spring 888, Emperor Xizong died, and his brother Li Jie (who later changed his name to Li Min, and then to Li Ye) the Prince of Shou became emperor (as Emperor Zhaozong) with Yang Fugong's support. Emperor Zhaozong bestowed the honorary chancellor title of Shizhong (侍中) on Li Keyong. Meanwhile, in spring 889, Li Keyong had his adoptive son Li Cunxiao and Li Hanzhi command an army against Meng Fangli, quickly capturing two of the three Zhaoyi prefectures that Meng held — Ci (磁州, in modern Handan, Hebei) and Ming (洺州, also in modern Handan). They then put Meng's headquarters at Xing Prefecture under siege. Meng's officers were resentful of his heavy-handedness and refused to fight for him; in fear, he committed his suicide. They supported his brother Meng Qian (孟遷) to succeed him to try to resist Li Keyong. Meng Qian sought aid from Zhu Quanzhong, and Zhu sent his officer Wang Qianyu (王虔裕) to aid Meng Qian in defending Xing. By spring 890, Meng Qian was no longer able to resist, and he arrested Wang and surrendered to Li Keyong. Li Keyong took control of the region and commissioned An Jinjun as the military prefect (團練使, Tuanlianshi) of the prefectures he took from the Mengs. Immediately thereafter, Li Keyong attacked Helian Duo at Yun Prefecture, but Helian, with aid from Li Quanzhong's son and successor Li Kuangwei, repelled Li Keyong's attack. Meanwhile, when Li Keyong subsequently visited Zhaoyi to review the troops there, he rebuked and whipped Li Kexiu over minor matters — food and lodging — causing Li Kexiu to grow ill due to the anger and humiliation, and Li Kexiu soon died. Li Keyong made his younger brother Li Kegong (李克恭) the acting military governor of Zhaoyi, but the people of the circuit missed Li Kexiu's kindness and resented Li Kegong's harshness and therefore resented Li Keyong over Li Kexiu's death.

Although Emperor Zhaozong became emperor due to Yang's backing, he had long wanted to restore imperial power over eunuchs and warlords, and he therefore came into close association with the chancellors Zhang Jun and Kong Wei, who had similar ambitions for imperial power, to resist Yang's hold over the imperial government. Li Keyong, however, disrespected Zhang, and Zhang therefore resented him. In addition, Zhang wanted to assert imperial power by waging a successful campaign against a warlord. When, in light of Li Keyong's unsuccessful campaign against Helian, Helian, Li Kuangwei, and Zhu all submitted petitions requesting that Emperor Zhaozong condemn Li Keyong as a renegade and declare a general campaign against him, Zhang advocated the same. Emperor Zhaozong, despite his own initial reluctance and Yang's advice to the contrary, agreed with Zhang and, in summer 890, ordered a general campaign against Li Keyong, putting Zhang in command of the overall operations against Li Keyong with the official Sun Kui (孫揆) as Zhang's deputy, while ordering all circuits around Li Keyong to attack him. He also stripped Li Keyong of all of his imperially-granted titles and offices.

At the start of the imperial campaign against Li Keyong, the Zhaoyi officers An Jushou and Feng Ba (馮霸) mutinied and killed Li Kegong. An was subsequently killed in a disturbance, but Feng took over Lu Prefecture and submitted to Zhu. Zhu sent his officer Zhu Chongjie (朱崇節) to defend Lu, and Li Keyong immediately had Kang Junli and Li Cunxiao put Lu under siege. Zhu Quanzhong sent Ge Congzhou to reinforce Lu, while sending other officers to attack Li Hanzhi at Ze Prefecture. He then submitted a petition to Emperor Zhaozong that Sun, who had been named the military governor of Zhaoyi, be ordered to report to Zhaoyi. Zhang, who had taken the imperial forces, as well as reinforcements from the circuits near Chang'an, and advanced to Yindi Pass (陰地關, in modern Jinzhong, Shanxi), not wanting Zhaoyi to fall into Zhu Quanzhong's control, agreed, and sent Sun on his way to Zhaoyi in fall 890. Li Cunxiao ambushed Sun on the way and captured him, causing great distress to the morale of the imperial troops. (When Sun subsequently refused to submit to Li Keyong, Li Keyong put him to death.)

After Sun's capture, Li Hanzhi and Li Cunxiao defeated the Xuanwu troops that Zhu sent to Zhaoyi, and they were forced to abandon Zhaoyi and retreat back to Zhu's territory. (Li Keyong subsequently angered Li Cunxiao by making Kang the acting military governor of Zhaoyi, as Li Cunxiao believed that his accomplishment warranted being given Zhaoyi. Li Cunxiao thus began to have thoughts of turning against his adoptive father, but did not act on the thoughts at this point.)  Meanwhile, Li Kuangwei and Helian attacked Hedong from the north and had initial successes, capturing Wei Prefecture and Zhelu Base, but a counterattack by Li Keyong's adoptive sons Li Cunxin (李存信) and Li Siyuan subsequently defeated Helian and Li Kuangwei, and they withdrew in fall 890 as well.

In winter 890, Li Keyong's main forces prepared for a confrontation with the imperial and western circuits' troops at Yindi Pass. Han Jian the military governor of Zhenguo Circuit (鎮國, headquartered in modern Weinan) tried to ambush Li Cunxiao, but was defeated by Li Cunxiao. After Han's defeat, the forces from Jingnan and Fengxiang Circuits abandoned their positions and withdrew. The remaining imperial/western circuit forces collapsed. Zhang tried to regroup and make a counterattack, but was defeated by Hedong troops. Troops from Jingnan, Fengxiang, Baoda (保大, headquartered in modern Yan'an, Shaanxi), and Dingnan (定難, headquartered in modern Yulin, Shaanxi) fled, leaving the imperial, Zhenguo, and some Xuanwu troops that Zhu had sent with Zhang, who retreated to Jin Prefecture (晉州, in modern Linfen, Shanxi). Li Cunxiao put Jin under siege, but then concluded that capturing Zhang was counterproductive — as Hedong troops would have no good way of dealing with Zhang and his imperial troops, whom they could not slaughter. They thus lifted the siege to allow Zhang and Han to flee. They did so, and Li Cunxiao subsequently captured the region for Li Keyong. In light of Zhang's defeat, Emperor Zhaozong, to appease Li Keyong, exiled Zhang and Kong in spring 891 and restored all of Li Keyong's titles, further bestowing the honorary chancellor title of Zhongshu Ling (中書令) on him. Satisfied, Li Keyong returned to Hedong.

Protracted warfare against neighboring circuits
Li Keyong also resumed his campaign against Helian in summer 891, putting Yun Prefecture under siege. By fall 891, Helian had run out of food supplies, and he fled to Li Kuangwei's Lulong Circuit. Li Keyong took over Datong Circuit and made his officer Shi Shanyou (石善友) the defender of Datong. Meanwhile, at the suggestion of Li Cunxiao (who had now been made the military governor of Xingming Circuit — i.e., Meng Fangli's old territory), Li Keyong also launched an attack on Wang Rong's Chengde Circuit in fall 891, but after Li Kuangwei launched troops to aid Wang, Li Keyong withdrew back to Ming Prefecture. Wang and Li Kuangwei subsequently counterattacked in spring 892, but Li Keyong repelled them. Li Keyong and Wang Chucun subsequently attacked Chengde with indecisive results. He withdrew, and later in the year repelled an effort by Li Kuangwei and Helian to recapture Datong.

Meanwhile, by winter 892, Li Cunxiao had become fearful and resentful after Li Cunxin had accused him of being in secret communications with Wang Rong and Zhu Quanzhong. In reaction, Li Cunxiao in fact entered into a pact with Wang Rong and Zhu, and also submitted a petition to Emperor Zhaozong, offering the three prefectures that he controlled to the imperial government and asking for another campaign against Li Keyong. Emperor Zhaozong commissioned Li Cunxiao as the military governor of the three prefectures, but refused to declare a campaign against Li Keyong. In spring 893, Li Keyong put Li Cunxiao's headquarters at Xing Prefecture under siege, and when Wang Rong sent troops to try to aid Li Cunxiao, Li Keyong defeated them, and then shifted his attention to sieging Wang Rong's headquarters at Zhen Prefecture (鎮州). Li Cunxiao joined Wang in defending against Li Keyong, and both sought aid from Zhu, but Zhu was then locked into a prolonged confrontation with Shi Pu and could not come to their aid. Li Kuangwei, however, did, and defeated Li Keyong, who returned to Xing and again put it under siege. (The battle was costly for Li Kuangwei, however, as his brother Li Kuangchou used the opportunity to mutiny at Lulong's capital You Prefecture and seized the circuit. Li Kuangwei, for some time, remained at Zhen Prefecture as Wang Rong's honored guest, but when he then tried to seize the circuit from Wang Rong, Wang's guards killed him.)

In fall 893, when Wang again tried to come to Li Cunxiao's aid, Li Keyong defeated him and again attacked Zhen. Wang, in fear, agreed to stop aiding Li Cunxiao and agreed to supply Li Keyong's troops with food and reinforcements. Thereafter, Li Cunxiao became without outside aid, and soon was trapped inside Xing's city walls. He ran out of supplies in spring 894 and offered to surrender, and did actually do so when Li Keyong sent Lady Liu inside the city to escort him out. Li Keyong put Li Cunxiao under arrest and took him back to Taiyuan, ordering that he be publicly executed by drawing and quartering — but actually intending to spare Li Cunxiao, due to his past accomplishments. Li Keyong expected that at the execution, someone would speak up on Li Cunxiao's behalf, and then he could spare Li Cunxiao without losing authority, but all of the other officers were jealous of Li Cunxiao and therefore did not speak up — and the execution proceeded. After Li Cunxiao was executed, another fierce officer, Xue Atan (薛阿檀), whom the other officers similarly were jealous of and who was in secret communications with Li Cunxiao, committed suicide, and it was said that it was from this point on that Li Keyong's strength began to wane — although around this time, he was able to defeat and finally kill Helian.

Meanwhile, by this point, Zhu had defeated Shi and taken over Shi's Ganhua Circuit, and was further trying to conquer Tianping Circuit (天平, headquartered in modern Tai'an, Shandong), under the control of Zhu Xuan, and Taining Circuit, under the control of Zhu Xuan's cousin Zhu Jin. Both Zhu Xuan and Zhu Jin sought aid from Li Keyong, and Li Keyong repeatedly sent aid troops to them, with the permission of Luo Hongxin the military governor of Weibo Circuit (魏博, headquartered in modern Handan). Meanwhile, after Li Keyong initially failed in sending the Lulong officer Liu Rengong, who had fled to him after Li Kuangchou's mutiny against Li Kuangwei, back to Lulong to take it over, Li Kuangchou attacked Hedong. In winter 894, Li Keyong launched a major counterattack and captured Lulong, forcing Li Kuangchou to flee. (Li Kuangchou was subsequently killed by Lu Yanwei the military governor of Yichang Circuit (義昌, headquartered in modern Cangzhou, Hebei), when he tried to flee to Yichang.) Li Keyong installed Liu as Lulong's acting military governor.

Campaign against Wang Xingyu and Li Maozhen
Meanwhile, Li Keyong became involved in another confrontation with other military governors that started over a succession struggle at Hezhong Circuit. Wang Chongrong had been assassinated in 887 and been succeeded by his older brother Wang Chongying. After Wang Chongying died in spring 895, the Hezhong soldiers supported Wang Chongrong's adoptive son Wang Ke — the biological son of Wang Chongying's and Wang Chongrong's older brother Wang Chongjian (王重簡). Wang Chongying's sons Wang Gong the military governor of Baoyi Circuit (保義, headquartered in modern Sanmenxia, Henan) and Wang Yao (王瑤) the prefect of Jin Prefecture were displeased with the situation and engaged Wang Ke in battle; they further sought aid from Zhu Quanzhong, claiming that Wang Ke was not actually a blood relation to the Wangs. Wang Ke sought aid from both the imperial government and Li Keyong. Emperor Zhaozong initially sought to mediate the dispute. Li Keyong submitted a petition citing Wang Chongrong's contributions and asking that Wang Ke be made the military governor of Hezhong, and Emperor Zhaozong approved it. Wang Gong, on the other hand, allied himself with Wang Xingyu (whom Emperor Xizong had made the military governor of Jingnan after he killed Zhu Mei), Li Maozhen the military governor of Fengxiang, and Han Jian. Wang Xingyu, Li Maozhen, and Han submitted a petition asking that Wang Gong be given Hezhong and that Wang Ke be transferred to the smaller Baoyi Circuit. Emperor Zhaozong, citing the fact that he had already approved Li Keyong's petition, refused.

This precipitated a greater confrontation between Wang Xingyu, Li Maozhen, Han, and the imperial government. Wang Xingyu and Han had each previously sought control of two bases under control of the Shence Armies, and the eunuchs in charge of the Shence Armies refused to yield them. Further, Wang Gong claimed to them that Wang Ke and Li Keyong would eventually act against them. In summer 895, Wang Xingyu, Li Maozhen, and Han decided to force Emperor Zhaozong's hand by taking their troops to Chang'an, on the auspices of greeting the emperor. Once at Chang'an, they forced Emperor Zhaozong to issue an edict transferring Wang Gong to Hezhong, Wang Ke to Kuangguo Circuit (匡國, in modern Weinan), and Wang Xingyu's brother Wang Xingyue (王行約), then the military governor of Kuangguo, to Baoyi. They also killed the former chancellors Wei Zhaodu and Li Xi, whom they blamed for approving Li Keyong's petition, and further considered deposing Emperor Zhaozong and replacing him with his brother Li Bao (李保) the Prince of Ji. However, by this point, they heard that Li Keyong had already mobilized his troops and therefore decided they needed to concentrate on defending against him. They left troops at Chang'an to control Emperor Zhaozong (under command of Wang Xingyu's brother Wang Xingshi (王行實) and Li Maozhen's adoptive son Li Jipeng (李繼鵬)), and returned to their own circuits.

Li Keyong, hearing the news of the actions that Wang Xingyu, Li Maozhen, and Han took at the capital, launched his troops and issued a declaration accusing them of treason. He first attacked Wang Yao, killing him, and then advanced to Hezhong to rendezvous with Wang Ke. He quickly advanced to Chaoyi (朝邑, in modern Weinan), defeating Wang Xingyue there, and Wang Xingyue abandoned Kuangguo and fled. When news of this arrived at Chang'an, Wang Xingshi and the eunuch Liu Jingxuan (劉景宣) wanted to seize Emperor Zhaozong and flee to Jingnan's capital Bin Prefecture (邠州), while Li Jipeng and the eunuch Luo Quanguan (駱全瓘) wanted to seize Emperor Zhaozong and flee to Fengxiang. This erupted into street battles between Wang Xingshi and Li Jipeng, along with the Shence Armies (which they had taken over). Emperor Zhaozong's own personal guards fought off both Wang Xingshi and Li Jipeng, who then withdrew and headed for Jingnan and Fengxiang respectively. Emperor Zhaozong, under the protection of the imperial guard officers Li Yun (李筠) and Li Jushi (李居實), fled out of Chang'an and fled into the Qinling Mountains.

Meanwhile, Li Keyong entered Kuangguo's capital Tong Prefecture. Emperor Zhaozong, in flight, issued an edict to him and Wang Ke, ordering them to attack Wang Xingyu, while ordering Zhang Fan (張鐇) the military governor of Zhangyi Circuit (彰義, headquartered in modern Pingliang, Gansu) to block off any forces from Fengxiang. Li Keyong then attacked Han at his headquarters at Hua Prefecture (華州, in modern Weinan) and was poised to take it, when news arrived that Wang Xingyu and Li Maozhen had launched their own troops and were planning to seize the emperor. Li Keyong thus lifted the siege of Hua Prefecture and advanced toward Chang'an. He sent his officer Shi Yan (史儼) to Emperor Zhaozong to protect him, while advancing to Wang Xingyu's possession Liyuan Camp (黎園寨, in modern Xianyang). Hearing of Li Keyong's victory, Li Maozhen became fearful; he executed Li Jipeng and delivered Li Jipeng's head to Emperor Zhaozong, seeking forgiveness, and also sent emissaries to Li Keyong, asking for peace. Emperor Zhaozong agreed, and informed Li Keyong of the decision to pardon Li Maozhen, asking him to concentrate on Wang Xingyu. Emperor Zhaozong also gave one of his most beautiful concubines, Consort Chen the Lady of Wei, to Li Keyong.

Emperor Zhaozong then declared a general campaign against Wang Xingyu, putting Li Keyong in command of the operations. Li Maozhen, despite sending the emissaries to the emperor and Li Keyong, sent troops to aid Wang. Li Keyong thus asked Emperor Zhaozong to extend the campaign to Li Maozhen as well. Emperor Zhaozong disagreed, but issued an edict ordering Li Maozhen to withdraw. By winter 895, Liyuan fell. Wang Xingyue and Wang Xingshi, who were then at Ning Prefecture (寧州, in modern Qingyang, Gansu), abandoned it and fled. After Li Keyong then defeated Wang Xingyu at Longquan Camp (龍泉寨, in modern Weinan), Wang Xingyu fled back to Bin Prefecture and defended it, while sending offers to surrender to Li Keyong. Li Keyong refused. Wang then abandoned Bin Prefecture and fled; he was killed in flight by his own officers, and Li Keyong took Bin, but instead of taking control of it (or, as Li Hanzhi then requested, giving it to Li Hanzhi), recommended the imperial officer Su Wenjian (蘇文建) to be the military governor, and Emperor Zhaozong gave the circuit to Su.

For Li Keyong's accomplishments, Emperor Zhaozong created him the greater title of Prince of Jin, and also bestowed great honors on Li Hanzhi and Li Keyong's chief strategist Gai Yu. Meanwhile, Li Keyong secretly advised Emperor Zhaozong that Li Maozhen should also be destroyed — and that the imperial government will never have peace so as long as Li Maozhen stood. Emperor Zhaozong consulted with imperial officials, and a number of them feared that if Li Keyong destroyed Li Maozhen, he would be impossible to control, and Emperor Zhaozong therefore, while greatly praising Li Keyong, declined his proposal. He also sent Li Keyong an edict that declined to have Li Keyong come to Chang'an to greet him. Li Keyong then left the Chang'an region and returned to Hedong.

Contraction of power
This would mark the apex of Li Keyong's status as far as the Tang imperial government was concerned, however. As Li Keyong was waging his campaign in the west, Zhu Quanzhong was repeatedly defeating Zhu Xuan and Zhu Jing, and Li Keyong made repeated attempts to aid Zhu Xuan and Zhu Jing. In late 895, he sent Shi Yan and Li Chengsi (李承嗣), through Weibo territory, to rendezvous with Zhu Xuan and Zhu Jing. In spring 896, he again tried to send Li Cunxin to aid Zhu Xuan and Zhu Jing, but Zhu Quanzhong warned Weibo's military governor Luo Hongxin that Li Keyong had designs on the entire region north of Yellow River, including Weibo. Further, Li Cunxin's army had poor discipline and was pillaging the Weibo people as it went through Weibo, angering Luo. Luo thus launched a surprise attack at night against Li Cunxin, defeating him and forcing him to withdraw to Ming Prefecture. Thereafter, Luo no longer permitted Hedong forces passage through Weibo, causing Shi and Li Chengsi to be stuck at Tianping and no longer able to return to Hedong, and Luo thereafter became an ally of Zhu Quanzhong's.

In summer 896, Li Keyong tried to react by attacking Luo, and he enjoyed initial successes in his attack on Luo's capital Wei Prefecture (魏州). Zhu Quanzhong summoned Ge Congzhou, who was then attacking Zhu Xuan at Zhu Xuan's capital Yun Prefecture (鄆州) and sent him to aid Luo. Ge had his soldiers dig pit traps on the battlefield, and during the subsequent battle, Li Keyong's son Li Luoluo (李落落) fell into a pit and was captured, and when Li Keyong tried to rescue Li Luoluo, he himself fell into a pit and was almost captured as well, barely escaping with his life. Li Keyong tried to sue for peace with Zhu Quanzhong, hoping to ransom Li Luoluo; Zhu Quanzhong refused, and instead gave Li Luoluo to Luo, who executed him. Li Keyong was not able to again engage Luo, and withdrew. (Without Li Keyong's further aid, Zhu Xuan and Zhu Jing were not able to stand up to Zhu Quanzhong's repeated attacks, and by spring 897, Zhu Xuan would be captured and executed by Zhu Quanzhong, while Zhu Jing, Shi, and Li Chengsi would be forced to flee south to the territory of Yang Xingmi, who controlled Huainan by that point. )

Meanwhile, after Li Keyong's withdrawal from the Chang'an region, Li Maozhen and Han Jian continued their arrogance toward Emperor Zhaozong's court. In summer 896, Li Maozhen, believing that Emperor Zhaozong's attempt to reorganize the imperial guards and putting the imperial princes Li Jiepi (李戒丕) the Prince of Yan and Li Sizhou (李嗣周) the Prince of Qin in charge of them were intended to target him. He thus launched an attack against Chang'an. Li Jiepi initially advised Emperor Zhaozong to flee to Hedong to join Li Keyong, but after Emperor Zhaozong left Chang'an, Han made repeated overtures to Emperor Zhaozong, and Emperor Zhaozong, whose officials feared the long journey to Taiyuan, relented, and went to Hua Prefecture to join Han. Li Maozhen entered Chang'an and burned it. Meanwhile, Han, after initially showing deference to Emperor Zhaozong, essentially put Emperor Zhaozong under arrest, and put the imperial princes whom Emperor Zhaozong had trusted to death.

Meanwhile, Li Keyong prepared for another campaign to rescue Emperor Zhaozong. He ordered Liu Rengong to contribute troops, while also inviting Wang Rong and Wang Chucun's son and successor (Wang Chucun having died in 895) Wang Gao to join in the campaign as well. Liu claimed that he could not spare troops because he needed to defend against Khitan incursions, despite Li Keyong's repeated orders. Eventually, on one occasion, Liu threw Li Keyong's order onto the ground and tried to assassinate officers that Li Keyong had left at Lulong; they barely fled with their lives. In anger, Li Keyong launched a major attack against Liu in fall 897, but with him taking Lulong forces under Liu's son-in-law Dan Keji (單可及) lightly, he was defeated at Mugua Creek (木瓜澗, in modern Baoding), losing half of his troops, and the Lulong forces were only forced to withdraw due to a storm. After this battle, Liu became independent and was no longer under Li Keyong's command, entering into an alliance with Zhu Quanzhong instead.

In spring 898, when Wang Ke went to Taiyuan to marry Li Keyong's daughter, Li Keyong had his adoptive nephew Li Sizhao defend Hezhong (which by this point had been renamed Huguo (護國)) on Wang's behalf. Meanwhile, with Zhu repairing the Luoyang palace and announcing that he would like to invite Emperor Zhaozong to move the capital to Luoyang, Li Maozhen became fearful of a potential attack by Zhu, and therefore repaired the palace at Chang'an and invited Emperor Zhaozong to return to Chang'an, which Emperor Zhaozong did so in summer 898. At the same time, Zhu rendezvoused with Weibo troops and launched an attack on the three Zhaoyi prefectures formerly controlled by Li Cunxiao (Xing, Ming, and Ci); by summer 898, they had fallen to Zhu, who put Ge in command of them. Li Keyong thus lost his last foothold east of the Taihang Mountains. Therefore, by fall 898, when Emperor Zhaozong sent the imperial official Zhang Youfu (張有孚) to mediate the enmity between Li Keyong and Zhu, Li Keyong became willing to seek peace, and he tried to use Wang Rong as an intermediary to relay his hope for peace, but Zhu rejected the overture, and the enmity continued. In fall 898, Li Keyong sent Li Sizhao, Zhou Dewei, and Li Siyuan to try to recapture Xing, but they were defeated by Ge and forced to withdraw. Subsequently, Wang Gong, with aid from Zhu, attacked Wang Ke again, but Wang Ke was able to fend off the attack with aid from Li Sizhao.

Yet another blow would come to Li Keyong around the new year 899, however, when Xue Zhiqin (薛志勤), who was then serving as the military governor of Zhaoyi, died. Li Hanzhi, who was then the prefect of Ze Prefecture, had long wished to control a circuit again, and he took his troops and seized Zhaoyi's headquarters at Lu Prefecture. Li Keyong, in anger, sent emissaries to rebuke Li Hanzhi, who reacted by arresting Li Keyong's officers at Zhaoyi and delivering them to Zhu, seeking to ally with Zhu. While Li Sizhao almost immediately thereafter captured Ze Prefecture and arrested Li Hanzhi's relatives, Li Hanzhi was able to hold Lu with aid from Zhu's officers Zhang Cunjing (張存敬) and Ding Hui. Meanwhile, at the same time, Zhu assisted Luo in fending off a major attack by Liu, and in light of the victory, Ge made an incursion into Hedong territory, but was fought off by Zhou. Li Keyong was able to recapture Lu after Li Hanzhi's death in fall 899, but only with great difficulty.

In 900, when Zhu tried to attack north to capture Yichang, which was then under control by Liu's son Liu Shouwen, Li Keyong decided to come to the Lius' aid by having Zhou again attack Xing and Ming Prefectures, but Zhou was unsuccessful in capturing them. Meanwhile, Zhu also attacked Wang Rong and Wang Gao in fall 900, forcing Wang Rong to agree to terminate his relationship with Hedong, while Wang Gao fled to Hedong. Wang Gao's uncle (Wang Chucun's brother) Wang Chuzhi took over Yiwu Circuit and also agreed to cut off relations with Hedong.

In spring 901, Zhu further wanted to capture Huguo to put a stranglehold on Li Keyong. He thus had Zhang Cunjing attack and capture Jin and Jiang (絳州, in modern Yuncheng) Prefectures to cut off the potential aid from Li Keyong, while he himself attacked Huguo's capital Hezhong Municipality directly. Wang Ke sought aid from Li Keyong, but with Zhang in control of Jin and Jiang, Li Keyong was unable to aid him, and when he sought aid from Li Maozhen, Li Maozhen made no response. Wang Ke was forced to surrender, and Zhu took over Huguo. Li Keyong sent peace emissaries to Zhu, and while Zhu initially received them and sent emissaries of his own, decided against peace afterwards. Zhu thus launched a five-pronged attack on Hedong's capital Taiyuan commanded by Shi Shucong (氏叔琮), putting Taiyuan under siege and nearly capturing it. Only torrential rains that caused disease and the dwindling supplies for Zhu's army caused Zhu to order a retreat. However, during the campaign, Meng Qian, whom Li Keyong had given Zhaoyi, surrendered Zhaoyi to Zhu, and Zhu was thereafter able to retain Zhaoyi.

Meanwhile, at Chang'an, Emperor Zhaozong, who had been deposed by the powerful eunuchs in late 900 and replaced by his son Li Yu the Crown Prince, but returned to the throne in spring 901 after being rescued by Shence Army officers loyal to him, had been considering a proposal by the chancellor Cui Yin to slaughter the eunuchs. The powerful eunuch Han Quanhui thus considered preemptively assassinating Cui. Cui, finding this out, invited Zhu to bring troops to Chang'an to kill the eunuchs, and when the eunuchs found out, they, who were by this point allied with Li Maozhen, in turn seized Emperor Zhaozong and forced him to flee to Fengxiang. Zhu quickly arrived at Chang'an and then headed to Fengxiang, putting it under siege. Li Maozhen sought aid from Li Keyong. Li Keyong sent Li Sizhao and Zhou to attack the Jin/Jiang region, but by 902, they had been defeated by Shi Shucong and Zhu's nephew Zhu Youning (朱友寧), who then put Taiyuan under siege again. Li Keyong's situation became desperate enough that he considered a proposal by Li Cunxin to abandon Taiyuan and flee to Yun Prefecture. He only decided against the proposal due to the urging of Lady Liu, Li Sizhao, Li Siyuan, and Zhou. Shi and Zhu Youning eventually withdrew when their army was stricken by illnesses, and it was said that thereafter, for several years, Li Keyong did not dare to again confront Zhu Quanzhong. When Wang Shifan the military governor of Pinglu Circuit (平盧, headquartered in modern Weifang, Shandong) did rise against Zhu in 903 at the urging of Han and Li Maozhen, Li Keyong wrote him and praised his actions, but made only minor exploratory attacks against Jin Prefecture thereafter before terminating his own campaign after hearing that Zhu had already forced Li Maozhen to surrender Emperor Zhaozong to him and returned to Chang'an with Emperor Zhaozong. Subsequently, when Emperor Zhaozong, under Zhu's pressure, issued an edict that all eunuchs in the empire be slaughtered, Li Keyong saved the eunuch monitor to Hedong, Zhang Chengye, and executed another inmate in Zhang's stead.

In spring 904, Zhu killed Cui and forced Emperor Zhaozong to move the capital to Luoyang. On the way to Luoyang, Emperor Zhaozong made a final attempt to seek aid from Li Keyong, as well as Yang Xingmi and Wang Jian the military governor of Xichuan Circuit, sending secret emissaries to them, but neither Li Keyong nor Wang Jian acted on the call for aid. (Yang did, but after making some exploratory attacks gave up on the campaign as well.) Later in 904, Zhu assassinated Emperor Zhaozong and replaced him with his son Li Zuo the Prince of Hui (as Emperor Ai), and the Tang court came under Zhu's complete control.

In 906, Zhu launched a major attack on Liu Shouwen, and Liu Rengong sought aid from Li Keyong. Li Keyong initially refused to aid Liu, but after advice by his son Li Cunxu, who pointed out that if Zhu destroyed the Lius, no one else could stand up against Zhu. Li Keyong thus requisitioned troops from Liu Rengong and attacked Lu Prefecture. When he reached Lu, Ding Hui, whom Zhu had given the command of Zhaoyi but who had mourned Emperor Zhaozong's death bitterly, surrendered, allowing Li Keyong to regain control of Zhaoyi, whose command he gave to Li Sizhao. Hearing that Ding had surrendered Zhaoyi, Zhu gave up the campaign against Liu Shouwen and withdrew.

As independent Prince of Jin
In summer 907, Zhu Quanzhong forced Emperor Ai to yield the throne to him, ending Tang Dynasty. He established a new Later Liang Dynasty (as its Emperor Taizu). Most Tang military governors at least nominally submitted to him as emperor, with a few exceptions — Li Keyong, Yang Xingmi's son and successor Yang Wo (titled the Prince of Hongnong), Wang Jian (titled the Prince of Shu), and Li Maozhen (titled the Prince of Qi), all of whom initially continued to use the Tang era names to show refusal to submit to Later Liang. (Wang, however, soon declared himself emperor of a new state of Shu (commonly known as Former Shu)). In reality, Li Keyong's state of Jin was now an independent state, although when Wang wrote him and suggested that he assume imperial title as well, he refused, claiming continued loyalty to Tang. Later in the year, he met at Yun Prefecture with Yelü Abaoji, the ruler of the Khitan, and tried to enlist Yelü's aid in an alliance against Later Liang. Yelü initially agreed, but later entered into relations with Later Liang.

Meanwhile, Zhu sent his general Kang Huaizhen (康懷貞) to put Li Sizhao under siege at Lu Prefecture. Kang built walls and trenches around Lu Prefecture to cut off communications with the outside, and subsequent relief forces that Li Keyong sent under Zhou Dewei's command, while having some minor successes against Later Liang forces, were unable to lift the siege. By spring 908, Li Keyong had fallen seriously ill. He entrusted Li Cunxu, whom he designated as his heir, to his brother Li Kening, Zhang Chengye, Li Cunzhang, the officer Wu Gong (吳珙), and the secretary general Lu Zhi (盧質), while repeatedly stating to Li Cunxu that the immediate urgency after his death would be to rescue Li Sizhao. He then died and was succeeded as the Prince of Jin by Li Cunxu. When Li Cunxu would eventually declare himself the emperor of a new (or, renewed, under his view) Later Tang Dynasty in 923, he honored Li Keyong as Emperor Wu with the temple name of Taizu.

Personal information

 * Father
 * Li Guochang, posthumously honored Emperor Wenjing (honored 923)
 * Mother
 * Lady Qin, posthumously honored Empress Wenjing (honored 923)
 * Wife
 * Lady Liu, later honored consort dowager (honored 923)
 * Major Concubines
 * Lady Cao, mother of Princes Cunxu, Cunba, and Cunji, later honored empress dowager (honored 923), posthumously honored Empress Zhenjian
 * Lady Chen, the Lady of Wei, originally concubine to Emperor Zhaozong of Tang, later became Buddhist nun with the dharma name of Zhiyuan (智願), then Master Jianfa (建法大師), then Master Yuanhui (圓惠大師), then posthumously honored Master Guangguo (光國大師)
 * Lady Zhang, formerly the wife of Li Kuangchou
 * Children
 * Li Cunxu (李存勗) (885-926), later Emperor Zhuangzong of Later Tang
 * Li Cunba (李存霸), later the Prince of Yǒng (note different tone than his brother's title) (created 925, killed in mutiny 926)
 * Li Cunmei (李存美), later the Prince of Yōng (note different tone than his brother's title) (created 925)
 * Li Cunli (李存禮), later the Prince of Xue (created 925)
 * Li Cunwo (李存渥), later the Prince of Shen (created 925, killed 926)
 * Li Cunai (李存乂), later the Prince of Mu (created 925, executed by Emperor Zhuangzong 926)
 * Li Cunque (李存確), later the Prince of Tong (created 925, killed by An Chonghui/Huo Yanwei 926)
 * Li Cunji (李存紀), later the Prince of Ya (created 925, killed by An Chonghui/Huo Yanwei 926)
 * Li Tingluan (李廷鸞)
 * Li Luoluo (李落落) (killed by Luo Hongxin 896)
 * Li Cunju (李存矩) (assassinated 917)
 * Eldest daughter, born by Empress Dowager Cao, wife of Meng Zhixiang, later Grand Princess Qionghua (created 923?/925?) and Grand Princess Fuqing (created 930)
 * Daughter, wife of Wang Ye (王鄴), nephew of Wang Chucun
 * Daughter, wife of Wang Ke
 * Daughter, wife of Wang Yu (王郁), son of Wang Chuzhi
 * Adoptive Children
 * Li Cunxin (李存信), né Zhang Wuluo (張污落) (862-902)
 * Li Cunxiao (李存孝), né An Jingsi (安敬思) (executed 894)
 * Li Cunzhang (李存璋) (died 922)
 * Li Cunzhi (李存質)
 * Li Cunhao (李存顥) (executed 908)
 * Li Cunshi (李存實)
 * Li Cunshen (李存審), ne Fu Cun (符存) (died 924)
 * Li Cunjing (李存敬) (killed by Li Chong (李沖) 926)
 * Li Cunjin (李存進), né Sun Chongjin (孫重進) (857-922)
 * Li Cunxian (李存賢), né Wang Xian (王賢) (860-924)
 * Li Cunzhen (李存貞)
 * Li Siyuan (李嗣源), later Emperor Mingzong of Later Tang
 * Li Siben (李嗣本), né Zhang (張), created Weixin Khan (created 913, killed in battle 916)
 * Li Si'en (李嗣恩), né Luo (駱) (died 918)
 * Li Cunru (李存儒), né Yang Po'er (楊婆兒)

The Thirteen Grand-guardians
Li Keyong's 13 sons and adoptive sons who were made a grand-guardian (太保) at some point in their career are collectively called the 13 grand-guardians. They are namely Li Siyuan, Li Sizhao, Li Cunxu, Li Cunxin, Li Cunjin, Li Siben, Li Si'en, Li Cunzhang, Li Cunshen, Li Cunxian, Shi Jingsi, Kang Junli and Li Cunxiao. Except for Li Cunxu all are adoptive sons.

A few adaptations on the 13 grand-guardians include:
 * The Heroic Ones (十三太保), a 1970 Hong Kong Shaw Brothers Studio film, starring Ku Feng as Li Keyong, David Chiang as Li Cunxiao and Ti Lung as Shi Jingsi.
 * The Wild Bunch (十三太保), a 1982 Hong Kong TVB television series, starring Paul Chun as Li Keyong, Felix Wong as Li Cunxiao and Kent Tong as Kang Junli.