Li Mi (Sui dynasty)
Li Mi (; 582–619), courtesy name Xuansui (), pseudonym Liu Zhiyuan (), was a Chinese military general, monarch, poet, politician, and rebel. He was the leader of a rebel movement against the rule of the Chinese Sui dynasty. He initially was the strategist of the Sui general Yang Xuangan, who rebelled against Emperor Yang of Sui in 613 but failed. In 617, Li subsequently led a rebellion against Emperor Yang in his own right and killed Zhai Rang, seizing Zhai's troops. There was expectation that Li Mi would prevail over Sui forces and establish a new dynasty—so much so that even other key rebel leaders, including Dou Jiande, Meng Haigong (孟海公), Xu Yuanlang, and Zhu Can, were urging him to take imperial title. Even Li Yuan (soon to become the founder of the Tang dynasty as Emperor Gaozu) was writing him in supplicating terms that implicitly supported his imperial claim. Li Mi tried to gain control of the Sui eastern capital Luoyang, but his forces became stalemated by the Sui forces there, and he never came around to claiming the imperial title, instead accepting the title of Duke of Wei. In October 618, the Sui general Wang Shichong crushed his forces at Yanshi. Li Mi fled to Tang territory and submitted to Emperor Gaozu, but subsequently rebelled against Tang and tried to revive his own army. The Tang general Sheng Yanshi (盛彥師) captured and executed Li Mi. Background 
Li Mi came from a line that was part of the nobility during successive dynasties Western Wei, Northern Zhou, and Sui Dynasty. By the time of his father Li Kuan (), who carried the Sui-created title of Duke of Pushan, the clan, although not originally from there, lived at the Sui capital Chang'an. Due to his father's position, Li Mi became a guard of Emperor Yang of Sui, and he was said to view money lightly, using it to instead gather friends around him. One day, however, when Emperor Yang saw him, Emperor Yang was apprehensive of his appearance, and told his associate Yuwen Shu the Duke of Xu to have Li Mi removed. Thereafter, Yuwen persuaded Li Mi to resign from the imperial guard corps, and Li instead often traveled around the capital, riding a bull and reading while doing so—particularly the Book of Han. When the prime minister Yang Su the Duke of Yue saw him, Li knew it was the prime minister and he bowed and stated his name. Yang Su took Li to his mansion and talked with him. Yang then told his son Yang Xuangan, "Li Mi's intelligence and capability is far beyond yours." Sometimes, Yang Xuangan would bully Li, and Li responded:

I will be honest and not flatter you. On the battlefield, when two armies were facing off with each other, I am not as good as you at yelling and screaming to cause the enemy to be fearful and submissive. However, as far as gathering the capable men of the earth and letting them serve properly in their capacity, you are not as good as I. Why do you look down on the knowledgeable people just based on your high rank? Participation in Yang Xuangan's rebellion 

In 613, with Emperor Yang at the frontlines attacking Goguryeo, Yang Xuangan, who had been apprehensive since he heard rumors that Emperor Yang had remarked, "If Yang Su did not die, his clan would have eventually been exterminated," considered rebelling. Emperor Yang had put him in charge of keeping the supply lines clear near the eastern capital Luoyang, and Yang Xuangan took the opportunity to seize the gathered food supply and then declare a general rebellion against Emperor Yang. At the same time, he secretly sent his servants to Chang'an to summon Li and his brother Yang Xuanting (). Once Li arrived, Yang Xuangan made Li his chief strategist, and Li gave him three options, in the order of Li's opinion as to their feasibility:

Li's "high strategy" involved making a surprise attack on Jicheng (薊城, in modern Beijing) and Linyu (臨榆, in modern Qinhuangdao, Hebei), capturing those key locations to trap Emperor Yang, who then was on the Goguryeo front. Li believed that Goguryeo would then make a crippling attack on Emperor Yang, and that Emperor Yang's forces would either collapse on their own or surrender. Li's "middle strategy" involved making a surprise attack on Chang'an and capturing the surrounding Guanzhong region, and then holding the region and preparing for confrontation with Emperor Yang. Li's "low strategy" involved making a surprise attack on the eastern capital Luoyang and trying to capture it quickly and hold it as the command center. However, he warned that Tang Hui (), who had initially submitted to Yang Xuangan but who had since fled back to Luoyang, might have already warned the city to firm up its defenses—and that if Yang Xuangan put Luoyang under siege and could not capture it quickly, he would soon be trapped by converging Sui forces. Yang Xuangan, however, believing that he needed to capture Luoyang to show that his rebellion was serious, commented that Li's "low strategy" was in fact "high strategy," and headed toward Luoyang. However, as Li had predicted, Tang had warned Emperor Yang's grandson Yang Tong the Prince of Yue and the official Fan Zigai (), whom Emperor Yang left in charge of Luoyang, and Luoyang's defenses had been prepared. While Yang Xuangan and his brothers gained some victories, he could not quickly capture Luoyang. Meanwhile, many young noblemen were joining his cause. After he captured the highly regarded official Wei Fusi (), he trusted Wei as well and did not only trust Li any further, but strategies that Wei submitted were not wholeheartedly in support of the rebellion. Li requested that Yang Xuangan kill Wei, but Yang Xuangan refused. Li made the comment to his relatives, "The Duke of Chu wanted to rebel, but does not know how to gain final victory. We are now like turtles stuck in urns." When Li Zixiong () suggested that Yang Xuangan take imperial title, however, Li advised him that the act was inadvisable, and Yang agreed and did not do so. Soon, Wei Wensheng (), the official Emperor Yang left in charge of Chang'an, came to Luoyang's aid with his troops, and Lai Hu'er (), a general that Emperor Yang had also put in charge of keeping the supply line clear, also arrived. Further, the forward forces returning from the Goguryeo front, under the command of Qutu Tong () and Yuwen Shu, soon arrived as well, and while Yang Xuangan attempted to prevent them from crossing the Yellow River, attacks from Fan prevented Yang Xuangan from being able to cut Qutu and Yuwen off at the Yellow River, allowing them to cross. Yang Xuangan was soon losing battles, and under the suggestion of Li Zixiong and Li Mi, he decided to falsely declare that Yuan Hongsi (), the general in command at Honghua (弘化, in modern Qingyang, Gansu), was joining his cause, and that he was going to meet with Yuan. In fall 613, Yang Xuangan thus lifted the siege on Luoyang, and headed west. On the way, however, he was tempted by the people of Hongnong (弘農, in modern Sanmenxia, Henan), who opined that Hongnong would be easily captured and could be held. Further, the governor of Hongnong Commandery, Emperor Yang's cousin Yang Zhiji () the Prince of Cai, was intentionally insulting Yang Xuangan to enrage him. In anger, Yang Xuangan put Hongnong under siege, despite Li Mi's pleas that he was endangering his campaign by proceeding slowly. Yang Xuangan put Hongnong under siege for three days but could not capture it, and therefore had to continue to head west. By this point, the Sui forces commanded by Yuwen, Wei, Lai, and Qutu had caught up to him, and were dealing him defeats, and his forces collapsed. Yang Xuangan and his brother Yang Jishan fled to Jialurong (葭蘆戎, also in modern Sanmenxia) on foot, and Yang Xuangan, realizing that they were about to be captured and not wanting to be captured, asked Yang Jishan to kill him. Yang Jishan did so, and then tried to commit suicide, but before he could die, he was captured. After Yang Xuangan's death 
Li Mi was also captured, and he, Wei Fusi, Yang Jishan, and Wang Zhongbo () were taken by Fan Zigai, to be delivered to Emperor Yang, who was returning from the Goguryeo front as well. On the way, Li and Wang discussed escaping. They showed their jailers their gold, and told them, "When we die, please spend the proceeds to bury us; the rest of it, we leave it as a gift." The jailers began to be careless around Li and Wang, and they often feasted together. When they reached Wei Commandery (), they got the jailers drunk, and then Li, Wang, and five others dug a hole on the wall and escaped. As they fled, Li suggested to Wei that he flee with them—but Wei refused, believing that Emperor Yang would pardon him—a fateful decision, for Emperor Yang executed both him and Yang Jishan cruelly. For the next few years, Li travelled around, trying to find an agrarian rebel leader who would listen to his grand strategies, but his attempt to persuade Hao Xiaode () and Wang Bo () fell on deaf ears. Li was poor and often went hungry. At one point, he took the pseudonym Liu Zhiyuan and began teaching students in farming communities in Huaiyang Commandery (淮陽, roughly modern Zhoukou, Henan) how to read and write. During this period, he was so depressed that he wrote a poem about his ordeals, reading:

A golden wind has lost its gust. The dew has fallen on the dark forest. Tonight, this poor and confused man,
Is depressed in this Tao region with a broken heart. In the wild plains, the reed and the aloe are mixed;
In the wilderness near the village, the pigweed and the wild beans grow tall. I look and I listen with many emotions,
I lie down on my pillow in tears. But why do I shed tears? In sadness I think about the ancients. Without first ending adherence to the Qin,
How can the road to Han be clear? Fan Kuai was but a commoner in the market,
And Xiao He was but a minor bureaucraft. When they received their chances,
They gained posthumous names that lasted a thousand years. I talk about the heroes of the world,
But I shamefully live in emptiness. When Li finished the poem, he broke down in tears. People saw his behavior and reported to the commandery governor Zhao Tuo (), who sent soldiers to arrest him, but he was able to escape. He then went to his brother-in-law, Qiu Junming (), who was then the county magistrate for Yongqiu (雍丘, in modern Kaifeng, Henan). Qiu did not dare to keep him, but referred him to Wang Xiucai (), who was known for his bravery. Wang took Li in and gave his daughter to Li in marriage. Later, however, Qiu Junming's relative Qiu Huaiyi () informed on them, and by Emperor Yang's orders, the general Yang Wang () led soldiers to surround Wang Xiucai's house. Li happened to be away at the time and so escaped, but both Qiu Junming and Wang Xiucai were executed. Li again tried to visit the rebel leaders to try to persuade them to follow his strategies. Most of the leaders considered Li's strategies overly grandiose, and they initially did not respect him. However, as time went by, some of them began to respect Li, particularly when they heard prophecies that the next emperor would be named Li, some speculated that Li, who was of noble birth and who had many times escaped death, would be the one. He became particularly close to the rebel leader Wang Bodang (). Assassinating Zhai Rang 
By 616, Li Mi saw that Zhai Rang was the strongest rebel leader of the region, met Zhai through Wang Bodang. Li proposed some strategies for Zhai and was able to persuade some other rebel leaders to follow Zhai. Li therefore suggested to Zhai that, with Emperor Yang away at Jiangdu (江都, in modern Yangzhou, Jiangsu), he should gather his troops and attack Sui's two capitals: Luoyang and Chang'an. Zhai, not having the stomach yet of that grandiose design, did not accept the idea, but became more impressed with Li and kept Li as an honored guest. Meanwhile, because of prophecies that the next emperor would be named Li, the rebel leaders began to believe Li Mi might be the one prophesied. They thus began to submit to Li personally. When Zhai saw this, Zhai became even more impressed, and he considered accepting Li's plan. Li persuaded Zhai's strategist and astrologer Jia Xiong () to persuade Zhai to accept his plan. When Zhai asked Jia whether the signs indicated that Li's plan could succeed, Jia told him that it would, but that he might not be successful himself as the emperor, but should support Li. Zhai believed Jia and began to honor Li further. Under Li's advice, Zhai began to attack and capture the various cities within Yingyang Commandery. In response, Emperor Yang sent the general Zhang Xutuo (), who had previously been successful against rebel leaders, to attack Zhai. Zhai, who has previously lost some battles against Zhang, became fearful, but Li persuaded him that Zhang could be defeated. Under Li's suggestion, Zhai had Li take a thousand-man force and hide in a forest. As Zhang attacked Zhai, Li surprised Zhang, and Li, Zhai, Xu, and Wang surrounded Zhang. Zhang was initially able to fight his way out of the encirclement, but as he tried to rescue some of his officers, he was killed in battle, and Zhai's reputation was greatly enhanced, and he was able to gather much food supply. In light of the victory, Zhai let Li set up his own army, known as the Army of the Duke of Pushan. As Li's army grew, Zhai's soldiers began to have friction with Li's. Zhai thus separated his army from Li's and returned to Wagang, but soon regretted that decision and rejoined Li. In spring 617, Li persuaded Zhai that, with Emperor Yang away and Yang Tong in charge at Luoyang, the officials there were not of one mind. They thus sent Pei Shufang () to Luoyang to scout it, but Pei was discovered, and the Sui officials at Luoyang began to prepare for an attack. In response, Li and Zhai launched their assault at Luokou Storage (), a massive food storage that Emperor Yang built, and they captured it. They opened the food storage to allow the people to take food, and many people joined them. The Sui generals Liu Changgong () and Fang Shi (), viewing Zhai's forces as nothing more than bandits looking for food, took them lightly and attacked. Li and Zhai wore out the army from Luoyang with hunger, and then attacked, defeating it. Later, Li held a feast for Zhai Rang and then assassinated Zhai. As Duke of Wei 

In the aftermaths of the battle, Zhai Rang supported Li Mi as leader and offered the title of Duke of Wei—a title that Li's grandfather Li Yao () had previously carried during Northern Zhou—to Li. Li accepted, and changed the era name to show independence from Sui. Li made Zhai his prime minister and created him the Duke of Dong Commandery. Once Li made his declaration, the rebel generals of the region largely submitted to him, and much of modern central and eastern Henan came under Li's rule. However, after Sui reinforcements arrived from Jiangdu under the command of Wang Shichong, Li's advances, while initially successful over Wang as well, became stalled. By fall 617, Pei Renji had surrendered to him as well. Also joining him were Qin Shubao and Cheng Zhijie (). Despite the increasing number of followers, however, Li continued to be unable to capture Luoyang. When Chai Zhaohe () suggested to him—in accordance with his own suggestion to Yang Xuangan years earlier—that he commission Zhai and Pei to remain near Luoyang to keep the Luoyang troops checked, while he himself lead a surprise attack against Chang'an, Li responded that without capture Luoyang first, his followers would not be convinced that they could prevail, and so he did not accept Chai's suggestion. Meanwhile, another Sui general named Li—Li Yuan the Duke of Tang, who had been in charge of Taiyuan (太原, roughly modern Taiyuan, Shanxi) to guard against Eastern Tujue's attacks—rebelled at Taiyuan, claiming that he wished to support Emperor Yang's grandson Yang You the Prince of Dai, then nominally in charge at Chang'an, emperor. Li Yuan initially wrote Li Mi, trying to see if Li Mi would be willing to follow him, but Li Mi, believing in his own strength, had his secretary Zu Junyan (祖君彥, the son of the Northern Qi prime minister Zu Ting, whom both Emperor Yang and his father Emperor Wen had rejected as an official because Zu's false accusations against Hulü Guang had led to Northern Qi's downfall) write Li Yuan for him in this way:

Although I and you, my older brother, are of different branches, but we are both Lis. I know that I do not have sufficient strength, but by the love of the men on this earth, I have been made the leader. I hope that you will support and help me. Let us capture Ziying at Xianyang, and let us kill Xin of Shang at Muye; would it not be a great accomplishment? Li Yuan was dismayed but, not wanting to make another enemy, wrote back humbly:

Although I am ordinary and foolish, but I have had the opportunity to, by my ancestors' largess, receive the opportunity to be an imperial messenger when leaving the capital and a guard leader in the capital. If the administration falls and I am unable to help it, even the most understanding wise man will rebuke me. Therefore, I have organized a righteous army and sought peace with the barbarians to the north [i.e., Tujue] to try to calm the earth and to protect Sui. However, for the people under the heavens, there must be someone to rule over them, and other than you, who can be that person? I am too old—over 50—and that is not my intent, but I am happy to support you, my younger brother. I hope to be able to climb onto the scale of a dragon and hold onto the wing of a phoenix, and I hope that you, my younger brother, will soon, in accordance with the prophecy, pacify all who are on this earth. You are the leader among the Lis, and I hope that you will be gracious and accept me, and to give me again the domain of Tang; that will be enough glory for me. I do not have the heart to hear such commands as killing Xin of Shang at Muye, nor do I dare to listen to the order of capturing Ziying at Xianyang. Also, the Fen and Jin region [i.e., modern Shanxi] requires pacification right now, and I am not yet able to arrange a time for the meeting at Mengjin [(盟津, in modern Zhengzhou, Henan, where King Wu of Zhou met his supporters before attacking Shang's King Zhou)]. Li Mi was pleased with Li Yuan's response, believing that Li Yuan was willing to support him, and from that point on, Li Mi and Li Yuan often exchanged messengers. Li Yuan's campaign against Chang'an thus went without opposition from Li Mi, and Li Yuan was soon able to capture Chang'an, declaring Yang You emperor (as Emperor Gong) while making himself regent. Meanwhile, at the suggestion of Zhai's friend Xu Shiji, Li Mi sent Xu to capture another major food storage—Liyang Storage (黎陽倉, in modern Hebi, Henan)—and after doing so, opened up the storage to allow people in the region suffering from famines to take food. As a result, more than 200,000 men joined Li Mi within about 10 days, and a number of commanderies submitted to him, including the major rebel generals Dou Jiande and Zhu Can. The hermit Xu Hongke (), however, pointed out to him that once the food supplies ran out, he would have lost his opportunity, and therefore suggested making an attack along the Grand Canal against Jiangdu (江都, in modern Yangzhou, Jiangsu), where Emperor Yang was at, arguing that capturing Emperor Yang would cause the entire empire to submit to him. Li was unable to accept Xu Hongke's suggestion, but impressed with his strategy, invited Xu Hongke to join his staff. However, Xu Hongke refused and disappeared. Meanwhile, Li was prevailing over Wang Shichong in battles, but still was unable to capture Luoyang. By winter 617, there began to be friction between Zhai and several other generals under Li. Zhai's associate Wang Ruxin () and brother Zhai Hong () the Duke of Yingyang had both suggested Zhai seize power as regent and strip Li of his powers—suggestions that Zhai did not accept but Li eventually heard about. Zhai was also becoming greedy with spoils of war—torturing the general Cui Shishu () for money, battering Xing Yiqi () for refusing to gamble with him, and demanding large amounts of treasure from Fang Yanzao (), going as far as telling Fang:

When you recently attacked Ru'nan [(汝南, roughly modern Zhumadian, Henan)], you captured much gold, silver, and jewels, but you only gave them to the Duke of Wei, giving none to me. Be aware that it is I who allowed him to be duke, and who knows what will happen in the future? In fear, Fang informed this to Li, and he and Zheng Ting () both suggested that Li ambush Zhai. Li initially hesitated, believing that this would cause disunity among the ranks, but Zheng finally persuaded him that Zhai was too much of a risk. At a feast that Li held for Zhai Rang, Zhai Hong, Pei Renji, and Hao Xiaode, Li thus had his guard Cai Jiande () assassinate Zhai Rang, and then executed Zhai Hong, Zhai Rang's nephew Zhai Mohou (), and Wang Ruxin. Both Shan Xiongxin and Xu Shiji were also almost killed, but at the order of Wang Bodang, they were spared, and Li subsequently transferred Zhai's forces to Shan, Xu, and Wang Bodang. While few of Li's subordinates actually mourned the violent Zhai Rang, they began to become insecure about their own positions under him. In spring 618, Li Mi finally had a major victory over Wang Shichong, and after the victory, he seized Jinyong (), a key fortress near Luoyang, and moved his headquarters there, trying to put a strangle hold on Luoyang. When the Sui officials Duan Da () and Wei Jin () tried to attack him, he defeated them as well, killing Wei and forcing Duan back into Luoyang. Upon this victory, a number of Sui generals surrendered to him, and a number of other rebel leaders—including Dou, Zhu, Meng Haigong, and Xu Yuanlang all wrote submissions to him urging him to take imperial title, as did Pei Renji. Li Mi, however, stated, "I have not yet captured the eastern capital, and I cannot talk about doing this [i.e., taking imperial title]." However, soon there would be other challengers to Li's potential succession to Sui. Li Yuan, having nominally become a regent over Yang You, briefly considered the possibility of taking Luoyang himself, sending his sons Li Jiancheng and Li Shimin to Luoyang, claiming to be aiding it, but the Sui generals in Luoyang refused to acknowledge Li Yuan's authority and did not respond. Li Mi himself briefly engaged Li Jiancheng and Li Shimin, but after a minor skirmish, both sides disengaged, and Li Jiancheng and Li Shimin soon withdrew back to Chang'an. A larger threat loomed for Li Mi, however, as late in spring 618, a coup led by Yuwen Huaji (Yuwen Shu's son) at Jiangdu killed Emperor Yang, and Yuwen Huaji, after declaring Emperor Yang's nephew Yang Hao emperor, began to lead the elite Xiaoguo Army () back north, toward Luoyang, posing a major threat to Li Mi's hold over the region. Defeat 
Upon the news of Emperor Yang's death arriving at Sui's two capitals, two different reactions came about. At Chang'an, Li Yuan had Yang You pass the throne to him, establishing Tang Dynasty as its Emperor Gaozu, while at Luoyang, the Sui officials, led by a collective leadership of Duan Da, Wang Shichong, Yuan Wendu (), Huangfu Wuyi (), Lu Chu (), Guo Wenyi (), and Zhao Changwen (), declared Yang Tong emperor. Both the Sui officials and Li Mi were apprehensive about the approaching Yuwen Huaji. Yuan and Lu decided that the proper strategy was to seek Li's submission by pardoning him and awarding him high titles, and have him resist Yuwen—with an eye toward eventually turning against Li after he had been worn out. Meanwhile, Li had already engaged Yuwen several times, repeatedly prevailing over Yuwen but unable to definitively defeat him. Therefore, when Yang Tong's messengers arrived, Li seized the opportunity to suggest, making a submission to Yang Tong agreeing to be a Sui official and offering to attack Yuwen. Yang Tong then heaped a number of honors on Li—including creating him the Duke of Wei, now as formal Sui creation, and making him the nominal commander of all Sui forces. However, Wang opposed this rapprochement with Li, remarking that Yuan and Lu were awarding honors on a bandit, drawing suspicions from Yuan and Lu that Wang was intending to surrender the city to Yuwen. The Sui collective leadership thus began to suspect each other. In fall 618, Li, knowing that Yuwen's food supplies were running out, pretended to offer peace to Yuwen, agreeing to supply Yuwen's army with food, but instead planning to withhold food and, once Yuwen's food supplies did run out, attack. Li's plans, however, became known by Yuwen, and he in turn made a surprise attack on Li, nearly killing Li, but Qin Shubao protected Li from death, and eventually Yuwen was repelled. Yuwen, unable to gain food, headed north away from Li, and Li did not trail him. Meanwhile, at Luoyang, Wang began to incite his troops by telling them that they would soon fall into Li Mi's trap, and that if Li Mi received the command over them (as Li Mi was nominally bestowed the office of supreme commander of the armed forces), he would surely slaughter them for having resisted him. When Yuan received news that Wang was doing this, he planned to ambush Wang. However, Duan revealed the plot to Wang, and Wang started a coup himself first, killing Lu and surrounding the palace. Huangfu fled to Chang'an (to Tang). At Wang's insistence, Yang Tong surrendered Yuan, who remarked to Yang Tong, "If I die in the morning, Your Imperial Majesty will die in the evening." Yang Tong wept, but still sent Yuan to Wang, who executed Yuan. Wang then met Yang Tong and pledged his loyalty, swearing that all he intended was to save himself and save the empire. Yang Tong took Wang inside the palace to meet Empress Dowager Wang, and Wang swore before her as well. Nevertheless, from this point, all power was in Wang's hands, and Yang Tong himself was powerless. Upon hearing of Yuan and Lu's deaths, Li broke off the peaceful relations with Yang Tong's regime, now under Wang's control. However, he had a low opinion of Wang, so he did not take much precaution against an attack from Wang. Further, other problems were developing for Li—as while he had plenty of food supplies, he had a low amount of money and silk, and therefore had little to reward his generals with. He was also being overly generous with new adherents, and the old followers began to grumble. When Xu Shiji tried to get him to change his ways, he sent Xu away to Liyang under guise of promotion. In addition, his supply of new adherents began to dry up when he, in an ill-advised decision pushed by his secretary Bing Yuanzhen (), who could materially benefit from the transactions, to trade food with Wang for textiles. After the transactions began, the people of Luoyang, no longer low on food, stopped surrendering to Li, and while Li stopped the transactions, the damage had been done. In addition, his troops were tired, and a substantial percentage of his men were injured from fighting the elite Xiaoguo Army under Yuwen's command. Wang, seeing the weaknesses developing for Li's forces, decided to launch his own attack on Li. He gathered the most elite of his own troops and started to march against Li. Pei opined that Li should try to contain Wang's advances and then send part of the army to attack Luoyang while Wang was away. Li himself opined that he should refuse to engage Wang to let Wang's food supplies run out. However, his generals Chen Zhilüe (), Fan Wenchao (), and Shan Xiongxin all advocated a head-on engagement against Wang, and Li accepted their suggestion. In the subsequent Battle of Yanshi,  Wang sent his flanks to hide, and when Li engaged him, the flank forces attacked as well, leading to a general rout of Li's forces. Wang captured Yanshi (), where most of Li's officials kept their families, and the family members subsequently sent messages to those officials urging them to surrender. Li tried to withdraw to Luokou, but by the time he got there, Wang had caught up with him, and Bing surrendered Luokou to Wang; Shan surrendered as well. Li himself fled east to Hulao. Li initially considered further fleeing to Liyang, but he was warned that as Xu Shiji was nearly killed when Li killed Zhai Rang, he could not be assured of Xu's loyalty. He tried to reorganize his troops to fight Wang again, but the troops were largely unwilling to fight any further. Li therefore resolved to head west to surrender to Tang. Some 20,000 to 30,000 men followed him. Most of Li's former holdings submitted to Wang—i.e., nominally to Yang Tong. Surrender to Tang and death 
By winter 618, Li Mi was approaching Chang'an. Tang's Emperor Gaozu initially sent numerous messengers to him to express gratitude and welcome, and Li Mi expected Emperor Gaozu to give him a position equivalent to prime minister. However, once he actually arrived at Chang'an, his men were not respected and were given insufficient supplies. Soon, Emperor Gaozu made him the minister of palace supplies and created him the Duke of Xing. Li was not satisfied, particularly because the Tang officials largely looked down on him, and some demanded bribes. Only Emperor Gaozu himself showed him some respect, still referring to Li Mi as "my younger brother," and gave Li Mi his cousin Lady Dugu in marriage. Meanwhile, while most of Li Mi's holdings had surrendered to Yang Tong, Xu Shiji did not. Li Mi's follower Wei Zheng suggested to Emperor Gaozu that he be sent to encourage Xu to submit to Tang, and Emperor Gaozu sent Wei to do so. Xu Shiji decided to submit, but believing that it was proper that Li Mi himself make the submission, since he was still, in Xu's eyes, the sovereign of the lands, he declined to write a submission to Emperor Gaozu, only a report to Li Mi. Li Mi submitted Xu's report to Emperor Gaozu, and Emperor Gaozu, impressed with Xu, bestowed on him the imperial surname of Li. Later that year, at an imperial feast, Li Mi, as the minister of palace supplies, was forced to organize the feast, and he felt humiliated. He discussed the situation with Wang Bodang, who had followed him to Chang'an, and they believed that, with Xu Shiji and Zhang Shanxiang () still having substantial troops under their control, that he could reestablish himself. Li Mi thus spoke with Emperor Gaozu and offered to head back east to persuade his old adherents to submit to Tang. Around the new year 619, Emperor Gaozu, despite opposition by many of his officials, agreed, and he sent Li Mi east, assisted by Jia Runfu () and Wang Bodang. After Li Mi departed Chang'an, however, Emperor Gaozu changed his mind and tried to summon Li Mi back to Chang'an. Li Mi had reached Chousang (綢桑, in modern Sanmenxia, Henan) by that point, and he was fearful of what Emperor Gaozu was intending. Despite Jia's and Wang's opposition, he decided to rebel. He made a surprise attack on Taolin (桃林, also in modern Sanmenxia), capturing it. He then publicly declared that he was heading to Luoyang, but instead was heading to Xiangcheng (襄城, in modern Pingdingshan, Henan), where Zhang was. His movement was anticipated by the Tang general Sheng Yanshi, however, who laid a trap for him on the way to Xiangcheng. Sheng killed him and Wang. Traditional Chinese historians, while writing from a Tang perspective, nevertheless could not help to show admiration for Li Mi and some degree of lament. For example, the Later Jin historian Liu Xu, in his Old Book of Tang, commented:

Sui rule was corrupt, and Emperor Yang was misguided and immoral, being harsh on the heartland and adventuring far to Liaodong. He lacked capable assistance in governing the empire and capable local officials in governing the locales. The two capitals were empty and the people were tired. Li Mi first rebelled in order to save the people, holding strategies in his heart and willing to personally face swords and arrows. He occupied where the Luo River [(洛水, flowing near Luoyang)] flowed into the Yellow River, claiming to have a million men. People like Dou Jiande all submitted to him, and even the Duke of Tang [i.e., Emperor Gaozu] showed support for him. Was his accomplishment not great? While he lost the Battle of Yanshi, he still had several tens of thousands of men. If he had been without suspicions in his chest and showed full of openness in his heart, he chould have headed to Liyang, using Xu Shiji as his general and Wei Zheng as his strategist. Whether he would have been successful would be difficult to tell. However, Heaven had already favored someone else, and his chance was over. He was at least more fortunate than Chen She. He was the first to rise in rebellion but was finally willing to surrender to others. Did he not know that this put him in great danger? Further, he could not actually submit, contributing his abilities to serve the emperor, and he finally rebelled, becoming only a madman. He did not accept Wang Bodang's words, and he finally suffered disaster at Taolin. Some have compared him to Xiang Yu. Even if he had sufficient civil and military abilities to match, he was far more lacking in bravery and decisiveness. If Yang Su had favored Li Mi's abilities, he should have let Li Mi be a servant of the emperor, but instead he gave Li Mi to his idiotic son [i.e., Yang Xuangan], finally leading to the slaughter of his house. How was that appropriate? The Song Dynasty historian Ouyang Xiu, in his New Book of Tang, also commented:

Some have compared Li Mi to Xiang Yu, but it was an inapt comparison. When Xiang rose, it took him only five years to unite the empire. Li fought for a long time, for tens and hundreds of battles, and could not capture the eastern capital. When Yang Xuangan rose, Li first advised him to seize Guanzhong [(i.e., the Chang'an region)], but when he himself became leader, he could not beat his drums and head west, and that led to his defeat. Li's good treatment of his adherents was comparable to Tian Heng [(田橫, who was one of the Qi princes who tried and failed to revive Qi after the destruction of Qin Dynasty)], and was far superior to Chen She. Even if Li did not rebel, Tang could not have allowed him to remain for long. Emperor Gaozu sent Li Mi's head to Li Shiji and explained to him how Li Mi had rebelled. Li Shiji mourned Li Mi, and by Emperor Gaozu's permission buried Li Mi's body with a grand ceremony. As Li Mi had long been loved by his soldiers, many mourners were cried so hard that they spat up blood. Popular culture
 Portrayed by Felix Wong in the TVB series The Grand Canal. Portrayed by Lawrence Ng Wai Kwok in the TVB series Ancient Heroes (1996). Portrayed by Choi Jae-sung in 2006–2007 SBS TV series Yeon Gaesomun. Notes

Era name 
 Weigong (魏公 wèi gōng ("Duke of Wei")) 617–618

Personal information 
 Father
 Li Kuan (), Sui Dynasty official with the title of Duke of Pushan
 Wives
 Lady Wang, daughter of Wang Xiucai ()
 Lady Dugu, cousin of Emperor Gaozu of Tang (married 618)

582 births
619 deaths
7th-century Chinese monarchs
Chinese nobility
Generals from Shaanxi
Poets from Shaanxi
Politicians from Xi'an
Sui dynasty generals
Sui dynasty poets
Sui dynasty government officials
Tang dynasty government officials
Transition from Sui to Tang
Writers from Xi'an
Executed Sui dynasty people