Transition from Sui to Tang
The transition from Sui to Tang refers to the transition period between the end of the Sui dynasty and the start of the Tang dynasty, when the former dynasty's territories were carved into a handful of short-lived states by its officials, generals, and agrarian rebel leaders, and the process of elimination and annexation that followed which ultimately culminated in the consolidation of the Tang dynasty by the former Sui general Li Yuan. The transition started roughly around the year of 613 when Emperor Yang of Sui launched his first of three failed campaigns against Goguryeo, leading to a number of desertions in the army and the start of agrarian revolt against the Sui, and ended in 628, when Emperor Gaozu's son Li Shimin annexed the agrarian rebel ruler Liang Shidu's state of Liang, thereby once again unifying most of China under a single power.
As of 611, Sui Dynasty had just enjoyed more than two decades of peace and prosperity, as China had been united under it since it destroyed Chen Dynasty in 589, and aside from border conflicts with Eastern Tujue (which had since become a vassal state under its Qimin Khan Ashina Rangan) and Goguryeo, and one brief internal conflict between Emperor Yang of Sui, who became emperor in 604, and his brother Yang Liang the Prince of Han, the realm had not seen war. When Goguryeo's king Yeong-yang refused to pay homage to Emperor Yang in 610, Emperor Yang decided to plan a campaign to conquer it, and both he and the people believed that the conquest would be easy.
The logistics of staging the attack on Goguryeo, however, took much human and other tolls, as the building of a fleet and, particularly more so, the shipping of food and other supplies to the base of operations, Zhuo Commandery (涿郡, roughly modern Beijing), caused major disruptions in the farming cycle and major deaths in those conscripted to ship the supplies to Zhuo Commandery. In response, in 611, in northern China, those who were unwilling to be conscripted began to rise as agrarian rebels, led by leaders such as Wang Bo (王薄) and Liu Badao (劉霸道), and while Emperor Yang initially did not consider these rebels serious threats, the local governmental militias were unable to quell them.
Despite this, Emperor Yang launched his first campaign against Goguryeo in 612, crossing the Liao River into Goguryeo territory in spring 612. Emperor Yang personally led part of the army to put the important city Liaodong (遼東, in modern Liaoyang, Liaoning) under siege, while he sent the Xianbei generals Yuwen Shu and Yu Zhongwen (于仲文) to lead the rest of the army deep into Goguryeo territory, heading toward the Goguryeo capital Pyongyang, joined by the fleet commanded by the southern Chinese general Lai Hu'er. Emperor Yang, however, was never able to capture Liaodong, while Yuwen and Yu, advancing nearly to Pyongyang, were defeated by the Goguryeo general Eulji Mundeok and forced to withdraw with heavy losses. By fall 612, Emperor Yang was forced to terminate the campaign and withdraw as well, with only minor territorial gains. About 300,000 men had been lost in the campaign.
Not deterred, Emperor Yang launched a second campaign against Goguryeo in 613, even though the agrarian rebellions were becoming more numerous and serious. He again headed for Liaodong himself and put it under siege, while sending Yuwen Shu with another Xianbei general Yuchi Yichen toward Pyongyang. While he was sieging Liaodong, however, the northern Chinese general Yang Xuangan, in charge of logistics near the Sui eastern capital Luoyang, rose in rebellion, attacking Luoyang. When Emperor Yang heard the news, he withdrew his forces and sent Yuwen and Qutu Tong back to Luoyang ahead of himself, and Yuwen and Qutu joined with Fan Zigai (樊子蓋) and Wei Wensheng (衛文昇), the commanders of forces that Emperor Yang had left at Luoyang and Chang'an respectively, to defeat Yang Xuangan. Emperor Yang carried out heavy-handed reprisals against actual or perceived adherents of Yang Xuangan, but such actions did not deter further rebellions.
Despite this, Emperor Yang launched a third campaign against Goguryeo in 614. As Lai Hu'er reached the Yalu River, however, Goguryeo submitted, sending Yang Xuangan's Turkic confederate Husi Zheng (斛斯政), who had fled to Goguryeo, back to Sui as a sign of submission. Emperor Yang terminated the campaign, but when he again summoned Gao Yuan to pay homage to him, Gao Yuan ignored his summons. Emperor Yang began to plan a fourth campaign, which, however, he was never able to launch.
Meanwhile, in the fall of 615, while Emperor Yang and Empress Xiao were conducting a tour of the northern frontier, Qimin Khan's son and successor Shibi Khan launched a surprise attack against Yanmen Commandery as a reprisal for the emperor's proposal to give a princess to his brother and for the treacherous murder of one of his close advisors. The khan's wife Princess Yicheng, a relative of the emperor who had been personally honored by the empress during an earlier visit, sent them a secret warning about the Turkish attack. The imperial entourage fled to the fortified commandery seat at present-day Daixian, Shanxi, where Shibi Khan's forces besieged them on September 11. Yu Shiji advised the emperor to raise morale among the soldiers by promising promotion and rewards, as well as promising to abandon the unpopular campaigns against Goguryeo; this had the desired effect and Sui forces loyally rushed to the area to lift the siege. Meanwhile, however, the empress's brother Xiao Yu had gotten the emperor to seek further assistance from Princess Yicheng, who was administering military affairs at home in her husband's absence. She sent a false report to the khan that a northern attack had been launched against the khaganate; between this report and others announcing the Chinese reinforcements, Shibi Khan lifted the siege and returned north. With credit for his salvation muddled, Emperor Yang followed the advice of Su Wei and Yuwen Shu and reneged on most of his promises, causing great resentment among the military.
Despite (or perhaps because of) increasing agrarian rebel activities in northern China, however, Emperor Yang did not return to Chang'an or stay at Luoyang, but went to Jiangdu (江都, in modern Yangzhou, Jiangsu) in fall 616. With his departure from Luoyang, the rebels near Luoyang coalesced under the leadership of Yang Xuan'gan's former strategist Li Mi, who was proclaimed the Duke of Wei and considered the presumptive eventual emperor by most rebel leaders throughout northern China. Li, however, was not able to capture Luoyang and never claimed the imperial title.
Meanwhile, Yuchi Yichen made an attempt to destroy the rebels north of the Yellow River, but while he enjoyed some successes, Emperor Yang and his prime minister Yu Shiji, fearing Yuchi Yichen's military strengths, recalled him under guise of a promotion, allowing the rebel activities north of the Yellow River to reinvigorate themselves and become difficult to control, under the leadership of Dou Jiande.
By 617, a number of other major rebel leaders also began to control significant portions of territory. These include:
Several of these rebel leaders—including Li Yuan, Liu Wuzhou, Liang Shidu, Dou Jiande, and Gao Kaidao—formally submitted to Ashina Duojishi and received Eastern Tujue military aid, with Ashina Duojishi's strategy apparently to keep China divided. In winter 617, Li Yuan captured Chang'an, declaring Yang You emperor (as Emperor Gong), while honoring Emperor Yang as Taishang Huang (retired emperor); these declarations were not recognized by most of Sui territory, which still recognized Emperor Yang as emperor. Li himself became regent with the title of Prince of Tang.
Meanwhile, Emperor Yang, while realizing that the empire was in turmoil, felt secure under the protection of the elite Xiaoguo Army (驍果) at Jiangdu, and while he sent his general Wang Shichong to Luoyang to try to defend Luoyang against Li Mi's attacks, appeared to do little to quell the rebellions otherwise. Not wanting to return to northern China, he considered officially moving the capital to Danyang (丹楊, in modern Nanjing, Jiangsu, south of the Yangtze River). Meanwhile, the Xiaoguo Army soldiers, who were predominantly northerners and missed their homes, began to desert, and this met with heavy-handed punishment from Emperor Yang. In fear, the remaining Xiaoguo Army officers formed a plot, supporting the general Yuwen Huaji the Duke of Xu (Yuwen Shu's son) as their leader. In spring 618, they carried out a coup and killed Emperor Yang. Yuwen declared Emperor Yang's nephew Yang Hao, the Prince of Qin, the new emperor, but retained power himself as regent. He abandoned Jiangdu and headed back north, commanding the Xiaoguo Army.
Soon, news of Emperor Yang's death spread throughout the empire. At Chang'an, Li Yuan responded by having Yang You yield the throne to him, establishing the Tang Dynasty as Emperor Gaozu. At Luoyang, seven of the leading officials declared another grandson of Emperor Yang, Yang Tong the Prince of Yue, emperor, and Yang Tong was recognized as Sui's emperor by most of the commanderies that still recognized Sui sovereignty. With both the Sui administration at Luoyang and Li Mi fearing Yuwen's northward advancement, they formed a temporary alliance in which Li Mi recognized Yang Tong as his sovereign. After Li Mi repelled Yuwen Huaji, however, Wang Shichong, who opposed the alliance, seized power from the other officials and became regent, and the alliance with Li Mi was broken. Later that year, in a surprise attack, Wang defeated Li Mi, forcing Li Mi to flee to Tang. Li Mi was later killed by Tang forces when he tried to reestablish his own independence.
Meanwhile, after Xue Ju died in early 618 and was succeeded by his son Xue Rengao, the Tang general Li Shimin the Prince of Qin (Emperor Gaozu's son) defeated and killed Xue Rengao, annexing his Qin state into Tang. At the same time, Dou Jiande further consolidated his holdings north of the Yellow River and killed Yuwen Huaji(who had poisoned Yang Hao and declared himself Emperor of Xu), but was unable to get Luo Yi to submit to him, and Luo subsequently submitted to Tang. Around the same time, Zhu Can, facing heavy resistance from the populace against his cruelty, vacillated between submitting to Yang Tong's Sui regime and Tang, eventually surrendering to Sui.
In summer 619, Wang Shichong had Yang Tong yield the throne to him, ending Sui and establishing a new state of Zheng as its emperor.
Around the same time, Li Gui's official An Xinggui (安興貴) captured Li Gui in a coup and surrendered the state to Tang. Tang, however, was facing a threat on a different front, as Liu Wuzhou made a major attack south, taking over much of modern Shanxi, which Tang had controlled, and appearing poised to further attack Tang's capital Chang'an. Around the same time, the lower Yangtze region, which had been in a state of confusion ever since Emperor Yang's death, was coalescing around three different competing figures—the former Sui official Shen Faxing, who declared himself the Prince of Liang and controlled much of the territory south of the Yangtze; the rebel leader Li Zitong, who controlled Jiangdu and the surrounding regions, declaring himself the Emperor of Wu; and Du Fuwei, who submitted to Tang and was created the Prince of Wu.
In late 619, Tang forces, commanded by Li Shimin, began a counterattack against Liu Wuzhou. By summer 620, Li Shimin had defeated Liu, who abandoned his territory and fled to Eastern Tujue. His Dingyang state was integrated into Tang.
After defeating Dingyang, Li Shimin had his sights set on Zheng. He advanced to the Zheng capital Luoyang and put it under siege. Many Zheng cities surrendered to Tang, forcing Wang Shichong to seek aid from Dou Jiande's Xia state. Dou, reasoning that if Tang destroyed Zheng, his own Xia would be cornered, agreed, and he advanced south toward Luoyang, seeking to lift the siege. Around the same time, Du Fuwei(now using the name Li Fuwei, having been granted the imperial surname of Li by Emperor Gaozu) defeated Li Zitong, who in turn defeated Shen, forcing him to commit suicide. Li Zitong now had Shen's former territory, while Li Zitong's former territory was held by Li Fuwei in Tang's name.
In spring 621, with Dou approaching, Li Shimin advanced east to the important Hulao Pass and held position there. When Dou engaged him, he defeated Dou and captured him. In fear, Wang surrendered. Emperor Gaozu executed Dou while exiling Wang (although Wang was subsequently killed by the Tang general Dugu Xiude (獨孤修德), whose father had been executed by Wang). Wang's Zheng state and Dou's Xia state were annexed by Tang, although former Xia territory soon rose under the leadership of Dou's general Liu Heita, who declared himself the Prince of Handong, and modern Shandong, which had been controlled by the agrarian leader Xu Yuanlang but had successively submitted to Zheng and then to Tang, rose as well under Xu, who declared himself the Prince of Lu.
Also in 621, Emperor Gaozu's nephew Li Xiaogong the Prince of Zhao Commandery attacked Xiao Xian's Liang state in southern China, putting the Liang capital Jiangling under siege. Xiao, not realizing that relief forces were approaching, surrendered, and most of his state was annexed by Tang, while some of Xiao's army submitted to Lin Shihong. Around the same time, Li Fuwei defeated Li Zitong, forcing Li Zitong's surrender, and Li Zitong's Wu state was also annexed by Tang.
In spring 622, Li Shimin defeated Liu Heita, forcing Liu to flee to Eastern Tujue, but Liu returned later that year with Eastern Tujue aid, reoccupying the former Xia territory. In winter 622, Li Shimin's older brother Li Jiancheng the Crown Prince defeated Liu again, and in spring 623, Liu, in flight, was betrayed by his official Zhuge Dewei (諸葛德威) and executed by Li Jiancheng. Earlier, Lin Shihong had died, and his Chu state dissipated, with the cities gradually submitting to Tang, and soon after Liu's death, Xu, who had repeatedly been defeated by Tang forces, was also killed in flight. By this point, other than Liang Shidu and Gao Kaidao in the extreme north, China was largely reunited, if somewhat nominally, under Tang rule.
In fall 623, however, with Li Fuwei at Chang'an, Li Fuwei's lieutenant Fu Gongshi rebelled at Danyang, declaring himself the Emperor of Song and controlling the territory formerly under Li Fuwei's control. By 624, Li Xiaogong had defeated and killed Fu, reintegrating Song territory into Tang, while Gao, faced with a coup led by his subordinate Zhang Jinshu (張金樹), committed suicide, and his Yan state was also integrated into Tang.
Meanwhile, Liang Shidu, protected by Eastern Tujue aid, was holding up against Tang attacks, and Tang itself was continually harassed by Eastern Tujue raids. After Li Shimin ambushed and killed Li Jiancheng and another brother, Li Yuanji the Prince of Qi in 626 and effectively forced Emperor Gaozu to yield the throne to him (as Emperor Taizong), however, Tang began to turn the situation around. By 628, with Eastern Tujue in internal turmoil due to disagreements between the Jiali Khan Ashina Duobi (Ashina Duojishi's younger brother) and the subordinate Tuli Khan, Ashina Shibobi (阿史那什鉢苾, Ashina Duojishi's son), it was no longer able to protect Liang Shidu, and under Tang siege, Liang Shidu's cousin Liang Luoren (梁洛仁) killed Liang Shidu and surrendered. All of China was now under the rule of Emperor Taizong.