The Tang dynasty was an imperial dynasty of China that ruled from 618 to 907, with an interregnum between 690 and 705. It was preceded by the Sui dynasty and followed by the Five Dynasties and Ten Kingdoms period. Historians generally regard the Tang as a high point of Chinese civilisation, and a golden age of cosmopolitan culture. Tang territory, acquired through the military campaigns of its early rulers, surpassed that of the Han dynasty.
The Li family founded the dynasty after taking advantage of a period of Sui decline and precipitating their final collapse, in turn inaugurating a period of progress and stability in the first half of the dynasty's rule. The dynasty was formally interrupted from 690 to 705 when Empress Wu Zetian seized the throne, proclaiming the Wu Zhou dynasty and becoming the only legitimate Chinese female emperor. The An Lushan rebellion (755–763) led to devastation and the decline of central authority during the latter half of the dynasty. The Tang maintained a civil-service system by recruiting scholar-officials through standardised examinations and recommendations to office. The rise of regional military governors known as jiedushi during the 9th century undermined this civil order. The dynasty and central government went into decline by the latter half of the 9th century; agrarian rebellions resulted in mass population loss and displacement, widespread poverty, and further government dysfunction that ultimately ended the dynasty in 907.
The Tang capital at Chang'an (present-day Xi'an) was the world's most populous city for much of the dynasty's existence. Two censuses of the 7th and 8th centuries estimated the empire's population at about 50 million people, which grew to an estimated 80 million by the dynasty's end. The dynasty raised professional and conscripted armies of hundreds of thousands of troops to contend with nomadic powers for control of Inner Asia and the lucrative trade-routes along the Silk Road. Far-flung kingdoms and states paid tribute to the Tang court, while the Tang also indirectly controlled several regions through a protectorate system. In addition to its political hegemony, the Tang exerted a powerful cultural influence over neighbouring East Asian nations such as Japan and Korea.
Chinese culture flourished and further matured during the Tang era. It is traditionally considered the greatest age for Chinese poetry. Two of China's most famous poets, Li Bai and Du Fu, belonged to this age, contributing with poets such as Wang Wei to the monumental Three Hundred Tang Poems. Many famous painters such as Han Gan, Zhang Xuan, and Zhou Fang were active, while Chinese court music flourished with instruments such as the popular pipa. Tang scholars compiled a rich variety of historical literature, as well as encyclopaedias and geographical works. Notable innovations included the development of woodblock printing. Buddhism became a major influence in Chinese culture, with native Chinese sects gaining prominence. However, in the 840s, Emperor Wuzong enacted policies to suppress Buddhism, which subsequently declined in influence.
The House of Li had ethnic Han origins, and it belonged to the northwest military aristocracy prevalent during the Sui dynasty. According to official Tang records, they were paternally descended from Laozi, the traditional founder of Taoism (whose personal name was Li Dan or Li Er), the Han dynasty general Li Guang, and Li Gao, the founder of the Han-ruled Western Liang kingdom. This family was known as the Longxi Li lineage, which also included the prominent Tang poet Li Bai. The Tang emperors were partially of Xianbei ancestry, as Emperor Gaozu of Tang's mother Duchess Dugu was part-Xianbei. Apart from the traditional historiography, some modern historians have suggested the Tang imperial family might have modified its genealogy to conceal their Xianbei heritage.
Emperor Gaozu (born Li Yuan) was the founder of the Tang. He was previously Duke of Tang and governor of Taiyuan, the capital of modern Shanxi, during the collapse of the Sui dynasty (581–618). Li had prestige and military experience, and was a first cousin of Emperor Yang of Sui (their mothers were both one of the Dugu 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 ('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 emperor of the newly founded Tang dynasty.
Emperor Gaozu 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. 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 favour, and Li Shimin ascended the throne. He is conventionally known by his temple name Taizong.
Although killing two brothers and deposing his father contradicted the Confucian value of filial piety, Taizong showed himself to be a capable leader who listened to the advice of the wisest members of his council. In 628, Emperor Taizong held a Buddhist memorial service for the casualties of war; in 629, he had Buddhist monasteries erected at the sites of major battles so that monks could pray for the fallen on both sides of the fight.
During the Tang campaign against the Eastern Turks, the Eastern Turkic Khaganate was destroyed after the capture of its ruler, Illig Qaghan by the famed Tang military officer Li Jing (571–649), who later became a Chancellor of the Tang dynasty. With this victory, the Turks accepted Taizong as their khagan, a title rendered as Tian Kehan in addition to his rule as emperor of China under the traditional title "Son of Heaven". Taizong was succeeded by his son Li Zhi (as Emperor Gaozong) in 649.
The Tang engaged in military campaigns against the Western Turks, exploiting the rivalry between Western and Eastern Turks in order to weaken both. Under Emperor Taizong, campaigns were dispatched in the Western Regions against Gaochang in 640, Karasahr in 644 and 648, and Kucha in 648. The wars against the Western Turks continued under Emperor Gaozong, and the Western Turkic Khaganate was finally annexed after General Su Dingfang's defeat of Khagan Ashina Helu in 657. Around this time, the Tang court enjoyed visits by numerous dignitaries from foreign lands. These were depicted in the Portraits of Periodical Offering, probably painted by Yan Liben (601–673).
Having entered Emperor Gaozong's court as a lowly consort, Wu Zetian ultimately acceded to the highest position of power in 690, establishing the short-lived Wu Zhou. Emperor Gaozong suffered a stroke in 655, and Wu began to make many of his court decisions for him, discussing affairs of state with his councillors, who took orders from her while she sat behind a screen. When Empress Wu's eldest son, the crown prince, began to assert his authority and advocate policies opposed by Empress Wu, he suddenly died in 675. Many suspected he was poisoned by Empress Wu. Although the next heir apparent kept a lower profile, Wu accused him of plotting a rebellion in 680; he was banished and later obliged to commit suicide.
In 683, Emperor Gaozong died and was succeeded by Emperor Zhongzong, his eldest surviving son by Wu. Zhongzong tried to appoint his wife's father as chancellor: after only six weeks on the throne, he was deposed by Empress Wu in favour of his younger brother, Emperor Ruizong. This provoked a group of Tang princes to rebel in 684. Wu's armies suppressed them within two months. She proclaimed the Tianshou era of Wu Zhou on October 16, 690, and three days later demoted Emperor Ruizong to crown prince. He was also forced to give up his father's surname Li in favour of the Empress Wu. She then ruled as China's only empress regnant in history.