Emperor Gaozu of Tang (; 7 April 566 – 25 June 635), personal name Li Yuan, courtesy name Shude, Xianbei name Daye Yuan, was the founding emperor of the Tang dynasty of China, reigning from 618 to 626 CE. Under the Sui dynasty, Li Yuan was the governor in the area of modern-day Shanxi, and was based in Taiyuan.
In 615, Li Yuan was assigned to garrison Longxi. He gained much experience by dealing with the Göktürks of the north and was able to pacify them. Li Yuan was also able to gather support from these successes and, with the disintegration of the Sui dynasty in July 617, Li Yuan – urged on by his second son Li Shimin (, the eventual Emperor Taizong) – rose in rebellion. Using the title of "Great Chancellor" (), Li Yuan installed a puppet child emperor, Yang You, but eventually removed him altogether and established the Tang dynasty in 618 with himself as emperor. His son and successor Li Shimin honoured him as Gaozu ("high founder") after his death.
Emperor Gaozu's reign was concentrated on uniting the empire under the Tang. Aided by Li Shimin, whom he created the Prince of Qin, he defeated all the other contenders, including Li Gui, Dou Jiande, Wang Shichong, Xue Rengao and Liu Wuzhou. By 628, the Tang dynasty had succeeded in uniting all of China. On the home front, he recognized the early successes forged by Emperor Wen of Sui and strove to emulate most of Emperor Wen's policies, including the equal distribution of land amongst his people, and he also lowered taxes. He abandoned the harsh system of law established by Emperor Yang of Sui as well as reforming the judicial system. These acts of reform paved the way for the reign of Emperor Taizong, which ultimately pushed Tang to the height of its power.
In 626, Li Shimin, in a dispute with his brothers Li Jiancheng, the Crown Prince, and Li Yuanji, the Prince of Qi, ambushed Li Jiancheng and Li Yuanji at Xuanwu Gate, killing them. Fearful of what Li Shimin might do next, Emperor Gaozu passed the throne to him and became Taishang Huang (retired emperor). He died on 25 June 635.
Early life and career According to the official genealogy of the Tang ruling house, Li Yuan's seventh-generation ancestor was Li Gao, the Han Chinese founder of the Dunhuang-based Sixteen Kingdoms state of Western Liang. After Western Liang's destruction by the Northern Liang, Li Gao's grandson Li Zhong'Er () served as a Northern Wei official, but for several generations after that, Li Yuan's ancestors had only minor military titles. Li Yuan's paternal grandfather Li Hu served as a major general under Western Wei's paramount general Yuwen Tai, and was created the Duke of Longxi and, as part of Yuwen's Xianbeification policy, given the Xianbei surname Daye (). Li Hu died before Yuwen Tai's son Emperor Xiaomin of Northern Zhou founded Northern Zhou, but was posthumously created the Duke of Tang after Northern Zhou's founding. His son and Li Yuan's father Li Bing, of Han ethnicity, inherited the title of the Duke of Tang and married one of the Dugu sisters and daughter of the prominent general, Dugu Xin, who was a Xianbei of Xiongnu descent. Li Bing died in 572, and Li Yuan inherited the title of Duke of Tang, a title he continued to hold after the Northern Zhou throne was seized by Emperor Wen of Sui (Yang Jian) in 581, establishing the Sui dynasty, as Emperor Wen's wife, Empress Dugu, was an aunt of his. Around this time, Li Yuan's family also changed their surname from Daye back to Li.
At some point, Li Yuan married Lady Dou, a daughter of Dou Yi () the Duke of Shenwu and Northern Zhou's Princess Xiangyang (Yuwen Tai's daughter) as his wife and duchess.
During Emperor Wen's reign (581–604), Li Yuan served three terms as a provincial governor. Early in the reign of Emperor Wen's son Emperor Yang, Li Yuan served as commandery governor (as Emperor Yang converted provinces into commanderies), but was later recalled to serve as a junior minister within Emperor Yang's administration. When Emperor Yang carried out his second campaign against Goguryeo in 613, Li Yuan was in charge of part of the logistics operation. When the general Yang Xuangan rebelled near the eastern capital Luoyang, Emperor Yang commissioned Li Yuan as a general and made him be in charge of the operations west of the Tong Pass, although Yang Xuangan's rebellion eventually did not involve that region. Li Yuan took the opportunity to recruit talented people to his staff. Later that year, when Emperor Yang summoned him to his presence, he declined, citing ill health—an excuse that Emperor Yang did not believe, as he questioned Li Yuan's niece, Consort Wang (Emperor Yang's concubine), "Will he die?". In fear, Li Yuan took up drinking and receiving bribes to try to show Emperor Yang that he did not have great ambitions. In 615, Emperor Yang placed him in charge of the operations against agrarian rebels in the Hedong () region (roughly modern Shanxi), but recalled him in 616. Later that year, Emperor Yang put him in charge of the key city of Taiyuan (, in modern Taiyuan, Shanxi).
Rebellion against Emperor Yang of Sui Emperor Yang grew dissatisfied with Li Yuan and Wang Rengong (), the governor of Mayi Commandery (, roughly modern Shuozhou, Shanxi), over their inability to stop incursions by the Eastern Turks (Tujue) and the growing strength of agrarian rebels—particularly the Turk-supported Liu Wuzhou, the Dingyang Khan, who soon rose against Wang and killed him and captured Emperor Yang's secondary palace near Taiyuan. Li Yuan also became fearful due to prophecies circulating throughout the empire that the next emperor would be named Li—and because Emperor Yang had killed another official, Li Hun () and his clan over his fears that Li Hun's nephew Li Min (, the son-in-law of Emperor Yang's sister Yang Lihua, the Princess Leping) had imperial ambitions.
Traditional accounts, compiled during the reign of Li Yuan's second son by the Duchess Dou, Li Shimin (Emperor Taizong), emphasize the latter's initiative and major role in instigating his father's rebellion. According to these, Li Shimin was secretly planning rebellion against Sui rule with Pei Ji, the majordomo of Emperor Yang's secondary palace, and with Liu Wenjing, the magistrate of Jinyang County (, i.e., Taiyuan), but at first did not reveal their plans to Li Yuan. At Li Shimin's urging, Pei Ji, who had also earlier, against regulations, allowed Li Yuan to have sexual relations with some of late Emperor Wen's imperial concubines, persuaded Li Yuan that it was necessary for him to rebel. Modern researchers, however, have concluded that the initiative for the revolt came from Li Yuan himself.
Li Yuan began to gather forces from the region, claiming that they were necessary to defend against the Turks, which drew suspicions from his deputies Wang Wei () and Gao Junya (). Li Yuan, afraid that Wang and Gao would act against him first, then used a Turkic attack as an excuse to falsely claim that Wang and Gao were working in concert with the Turkic khagan, Shibi Khan (Ashina Duojishi), and had them executed. He sent secret messengers to Hedong to recall his sons Li Jiancheng, Li Yuanji (both by Duchess Dou) and Li Zhiyun (, by his concubine Lady Wan), whom he had left there to watch over his household, and the capital Chang'an (modern Xi'an) to recall his daughter (the future Princess Pingyang) and her husband Chai Shao (). Li Jiancheng and Li Yuanji, leaving Li Zhiyun at Hedong, soon met with Chai, and they arrived together at Taiyuan. Li Yuan's daughter, believing it would be difficult for her to flee with Chai, chose to hide instead.
Once Li Jiancheng, Li Yuanji, and Chai arrived at Taiyuan, Li Yuan formally declared his rebellion, but maintained the guise of a Sui loyalist and declared that his intention was simply to install on the throne Emperor Yang's grandson Yang You, the Prince of Dai, who was then at Chang'an, and honor Emperor Yang as Taishang Huang (retired emperor). Li Yuan first secured his northern flank by contacting Shibi Khan, offering tribute, and received men and horses in exchange. He put Li Jiancheng and Li Shimin in charge of his army and, leaving Li Yuanji in charge at Taiyuan, advanced south. Meanwhile, the Sui officials at Hedong arrested Li Zhiyun and delivered him to Chang'an, where he was executed.
His daughter Pingyang sold her possessions to raise an army for him. She persuaded several other leaders to fight under her banner. They took several towns and her army swelled until she had 70,000 troops under her command.
Meanwhile, Li Yuan wrote another rebel leader, Li Mi the Duke of Wei, who was near Luoyang, 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 () write Li Yuan for him in this way:
Li Yuan was dismayed but, not wanting to make another enemy, wrote back humbly:
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. Meanwhile, however, when Li Yuan arrived near Hedong, his army was bogged down by the weather, and with food running out, there were rumors that Eastern Tujue and Liu Wuzhou would attack Taiyuan. Li Yuan initially ordered retreat, but at the earnest opposition by Li Jiancheng and Li Shimin, continued to advance. After defeating Sui forces at Huoyi (霍邑, also in modern Yuncheng), he decided to leave a small contingent to watch over Hedong while advancing across the Yellow River into Guanzhong (i.e., the Chang'an region). Once he did, he headed for Chang'an himself, while sending Li Jiancheng to capture the territory around the Tong Pass region to prevent Sui forces at Luoyang from reinforcing Chang'an and Li Shimin north of the Wei River to capture territory there. Meanwhile, his daughter had also risen in rebellion in support of him, and she was able to gather a sizable army and capture some cities. She joined forces with Li Shimin and her husband Chai Shao. Soon, Li Yuan reconsolidated his forces and put Chang'an under siege. In winter 617, he captured Chang'an and declared Yang You emperor (as Emperor Gong). He had himself made regent (with the title of grand chancellor) and created the Prince of Tang. (Meanwhile, most of Sui territory did not recognize Yang You as emperor and continued to recognize Emperor Yang as emperor and not as retired emperor.) He sent his nephew Li Xiaogong south, and Li Xiaogong was able to persuade the Sui cities in modern southern Shaanxi, Sichuan, and Chongqing to submit.
Establishment of Tang and gradual unification
In spring 618, Emperor Yang was killed at Jiangdu (, in modern Yangzhou, Jiangsu) in a coup led by the general Yuwen Huaji. When the news reached Chang'an, Li Yuan had Yang You yield the throne to him, becoming Emperor Gaozu of the Tang dynasty. He restored much of the institutions of Sui's first ruler, Emperor Wen, reversing a number of changes that Emperor Yang made. He created Yang You the Duke of Xi, Li Jiancheng, his oldest son, was named crown prince, while Li Shimin was made the Prince of Qin and Li Yuanji the Prince of Qi. Meanwhile, the Sui officials at Luoyang declared another grandson of Emperor Yang, Yang You's brother Yang Tong, the Prince of Yue, as emperor, and refused to recognize the regime change in Chang'an.