The Tang dynasty (//; Chinese: 唐朝[a]) or the Tang Empire was an imperial dynasty of China preceded by the Sui dynasty and followed by the Five Dynasties and Ten Kingdoms period. It is generally regarded as a high point in Chinese civilization, and a golden age of cosmopolitan culture. Its territory, acquired through the military campaigns of its early rulers, rivaled that of the Han dynasty, and the Tang capital at Chang'an (present-day Xi'an) was the most populous city in the world.
The dynasty was founded by the Lǐ family (李), who seized power during the decline and collapse of the Sui Empire. The dynasty was briefly interrupted when Empress Wu Zetian seized the throne, proclaiming the Second Zhou dynasty (690–705) and becoming the only Chinese empress regnant. In two censuses of the 7th and 8th centuries, the Tang records estimated the population by number of registered households at about 50 million people. Yet, even when the central government was breaking down and unable to compile an accurate census of the population in the 9th century, it is estimated that the population had grown by then to about 80 million people.[b] With its large population base, the dynasty was able to raise professional and conscripted armies of hundreds of thousands of troops to contend with nomadic powers in dominating Inner Asia and the lucrative trade routes along the Silk Road. Various kingdoms and states paid tribute to the Tang court, while the Tang also conquered or subdued several regions which it indirectly controlled through a protectorate system. Besides political hegemony, the Tang also exerted a powerful cultural influence over neighboring East Asian states such as those in Japan and Korea.
The Tang dynasty was largely a period of progress and stability in the first half of the dynasty's rule, until the An Lushan Rebellion and the decline of central authority in the later half of the dynasty. Like the previous Sui dynasty, the Tang dynasty maintained a civil service system by recruiting scholar-officials through standardized examinations and recommendations to office. This civil order was undermined by the rise of regional military governors known as jiedushi during the 9th century. Chinese culture flourished and further matured during the Tang era; it is considered the greatest age for Chinese poetry. Two of China's most famous poets, Li Bai and Du Fu, belonged to this age, as did many famous painters such as Han Gan, Zhang Xuan, and Zhou Fang. There was a rich variety of historical literature compiled by scholars, as well as encyclopedias and geographical works. The adoption of the title Tängri Qaghan by the Tang Emperor Taizong in addition to his title as emperor was eastern Asia's first "simultaneous kingship".
There were many notable innovations during the Tang, including the development of woodblock printing. Buddhism became a major influence in Chinese culture, with native Chinese sects gaining prominence. However, Buddhism would later be persecuted by the state, subsequently declining in influence. Although the dynasty and central government were in decline by the 9th century, art and culture continued to flourish. The weakened central government largely withdrew from managing the economy, though the country's mercantile affairs stayed intact and commercial trade continued to thrive regardless, at least until agrarian rebellions in the latter half of the 9th century brought the dynasty to its knees, resulting in damaging atrocities such as the Guangzhou massacre.
The Li family belonged to the northwest military aristocracy prevalent during the Sui dynasty and claimed to be paternally descended from the Daoist founder, Laozi (whose personal name was Li Dan or Li Er), the Han dynasty General Li Guang, and Western Liang ruler Li Gao. This family was known as the Longxi Li lineage (隴西李氏), which includes the Tang poet Li Bai. The Tang Emperors also had Xianbei maternal ancestry, from Emperor Gaozu of Tang's Xianbei mother, Duchess Dugu.
Li Yuan was Duke of Tang and governor of Taiyuan during the Sui dynasty's collapse, which was caused in part by the Sui failure to conquer the northern part of the Korean peninsula during the Goguryeo–Sui War. He had prestige and military experience, and was a first cousin of Emperor Yang of Sui (their mothers were sisters). Li Yuan rose in rebellion in 617, along with his son and his equally militant daughter Princess Pingyang (d. 623), who raised and commanded her own troops. In winter 617, Li Yuan occupied Chang'an, relegated Emperor Yang to the position of Taishang Huang or retired emperor, and acted as regent to the puppet child-emperor, Yang You. On the news of Emperor Yang's murder by General Yuwen Huaji on June 18, 618, Li Yuan declared himself the emperor of a new dynasty, the Tang.
Li Yuan, known as Emperor Gaozu of Tang, ruled until 626, when he was forcefully deposed by his son Li Shimin, the Prince of Qin. Li Shimin had commanded troops since the age of 18, had prowess with bow and arrow, sword and lance and was known for his effective cavalry charges. Fighting a numerically superior army, he defeated Dou Jiande (573–621) at Luoyang in the Battle of Hulao on May 28, 621. In a violent elimination of royal family due to fear of assassination, Li Shimin ambushed and killed two of his brothers, Li Yuanji (b. 603) and Crown prince Li Jiancheng (b. 589), in the Xuanwu Gate Incident on July 2, 626. Shortly thereafter, his father abdicated in his favor and Li Shimin ascended the throne. He is conventionally known by his temple name Taizong.