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.
Five Dynasties and Ten Kingdoms period
Traditionally, the era started with the fall of the Tang dynasty in 907 AD and ended with the founding of the Song dynasty in 960. Many states had been "de facto" independent kingdoms long before 907. After the Tang had collapsed, the kings who controlled the Central plain crowned themselves as emperors. War between kingdoms occurred frequently to gain control of the central plain for legitimacy and then over the rest of China. The last of the Five Dynasties and Ten Kingdoms states, the Northern Han, was not vanquished until 979.