Tang dynasty
Zhu Wen, originally a salt smuggler who had served under the rebel Huang Chao, surrendered to Tang forces. By helping to defeat Huang, he was granted a series of rapid military promotions. In 907 the Tang dynasty was ended when Zhu Wen, now a military governor, deposed the last emperor of Tang, Emperor Ai of Tang, and took the throne for himself (known posthumously as Emperor Taizu of Later Liang). He established the Later Liang, which inaugurated the Five Dynasties and Ten Kingdoms period. A year later Zhu Wen had the deposed Emperor Ai poisoned to death.
Tang campaign against the Eastern Turks
The Eastern Turkic Khaganate, which had been a vassal to Tang Dynasty's predecessor Sui Dynasty, had turned against Sui during the reign of Emperor Yang of Sui (r. 604-618) and subsequently, during Sui's breakup late in Emperor Yang's reign, had intervened in the process by supporting various claimants to the imperial title—including Tang's founder Emperor Gaozu, Xue Ju the Emperor of Qin, Liang Shidu the Emperor of Liang, Liu Wuzhou the Dingyang Khan, Gao Kaidao the Prince of Yan, Dou Jiande the Prince of Xia, and Liu Heita the Prince of Handong—playing them off against each other to try to make them subservient to the Eastern Turkic Khaganate. In 623, Liu Heita, the last major challenger to Tang rule, was captured and killed by Emperor Gaozu's crown prince Li Jiancheng, marking the reunification of China under Tang rule. The Eastern Turkic Khaganate, to which Emperor Gaozu still paid allegiance and tributes, began a campaign of routine pillaging incursions into Tang territory, effectively asserting authority over Tang territory in that manner, while continuing to protect Liang, who remained as the sole Chinese claimant of imperial authority against Tang, and also fostering the aspirations of Emperor Yang's young grandson Yang Zhengdao (楊政道), who was in the khaganate with his grandmother Empress Xiao and carried the title of Prince of Sui. The Turkic incursions were causing so many problems for the Tang that Emperor Gaozu considered burning the capital Chang'an to the ground and moving his seat to the modern southwestern Henan region, a proposal that was supported by Li Jiancheng, another son, Li Yuanji the Prince of Qi, and the chancellor Pei Ji, but vehemently opposed by Gaozu's son Li Shimin, the Prince of Qin. Due to Li Shimin's opposition (and guarantee that eventually he would be able to defeat the Eastern Turks), Emperor Gaozu abandoned the proposal.