Instruct: Given a question, retrieve passages that answer the question.
Query: Who was the last ruler of the Tang Dynasty?
Emperor Ai of Tang (27 October 892–26 March 908), also known as Emperor Zhaoxuan (昭宣帝), born Li Zuo, later known as Li Chu (Chinese:李柷; pinyin:Lǐ Chù[6]), was the last emperor of the Tang dynasty of China. He reigned—as but a puppet ruler—from 904 to 907. Emperor Ai was the son of Emperor Zhaozong.
China was in chaos after the fall of the Tang dynasty in 907. Known as the Wudai Shiguo period, Five Dynasties ruled northern China in rapid succession with only nominal support from the Ten Kingdoms of southern China. The Tang Dynasty had been supported by Shatuo Turks until Zhu Wen murdered the last Tang emperor and founded the Later Liang dynasty. The Shatuo Turks, who had been allied with the Khitan since 905, defeated the Later Liang and founded the Later Tang dynasty in 923, but by 926 the former allies had grown apart. In 934 Yelü Bei, Abaoji's son, wrote to his brother Emperor Taizong of Liao from the Later Tang court: "Li Cong Ke has slain his liege-lord, why not attack him?" In 936, the Khitan supported Shi Jing Tangs rebellion against the Later Tang Emperor Li Cong Ke. Shi Jing Tang became emperor of the Later Jin dynasty and, in exchange for their support, the Khitan gained sixteen new prefectures. 
The Later Jin dynasty remained a vassal of the Khitan until the death of Shi Jing Tang in 942, but when the new emperor aceded, he indicated that he would not honor his predecessor's arrangement. The Khitan launched a military invasion against the Later Jin in 944. In January 947, the Emperor of the Later Jin dynasty surrended to the Khitan. The Khitan emperor left the conquered city of Kaifeng and unexpectedly died from an illness while travelling in May 947.
Sima Qian relates that the dynasty itself was founded 13 generations later, when Xie's descendant Tang overthrew the impious and cruel final Xia ruler in the Battle of Mingtiao. The "Records" recount events from the reigns of Tang, Tai Jia, Tai Wu, Pan Geng, Wu Ding, Wu Yi and the depraved final king Di Xin, but the rest of the Shang rulers are merely mentioned by name. According to the "Records", the Shang moved their capital five times, with the final move to Yin in the reign of Pan Geng inaugurating the golden age of the dynasty.
The Tang campaigns against Karasahr were two military campaigns sent by Emperor Taizong of the Tang dynasty against the Tarim Basin kingdom of Karasahr, a vassal of the Western Turkic Khaganate. The city-state, which later became part of Xinjiang), may have been known to its inhabitants by the Tocharian name "Agni", which was rendered "Yanqi" in Chinese sources. The first campaign in 644 was led by the Tang commander Guo Xiaoke, protector-general of the Anxi Protectorate in western China, who defeated the oasis state and a Western Turkic army and installed a Tang loyalist as ruler. The second campaign in 648, which was part of the campaign against Karasahr's neighboring state of Kucha, was led by a Turkic general of the Tang Dynasty, Ashina She'er, who defeated and conquered Karasahr.
Some historians consider Wu to have begun in 902, when Yang Xingmi was named Prince of Wu by the Tang dynasty. All three rulers of Wu after 907 (when the Tang dynasty collapsed) were Yang Xingmi's sons. The first ruler Yang Wo was murdered by Xu Wen and Zhang Hao, and his two brothers after him were effectively puppets dominated by Xu Wen at first, and later Xu Wen's adopted son Xu Zhigao (Li Bian) who in 937 usurped power to establish Southern Tang. Yang Pu, the last ruler, was the only one to claim the title of emperor; the other rulers were kings or princes.
Murong Fuyun (慕容伏允) (597–635), formal title Busabo Khan (步薩鉢可汗), was a ruler of the Xianbei state Tuyuhun. He first became ruler when his brother Murong Shifu was assassinated in 597, and became one of the longest-ruling monarchs in Tuyuhun history. During his reign, he had major conflicts with China's Sui Dynasty and Tang Dynasty, and in 635, during a Tang invasion, he was assassinated due to the people's resentment of his hostile attitude toward Emperor Taizong of Tang that led to the invasion.
The empire of the Tang Dynasty (June 18, 618 – June 1, 907), successor of the Sui Dynasty, was a cosmopolitan hegemon that ruled one of China's most expansive empires. Raids by the nomadic Khitans and Turks challenged Tang rule, and Tang rulers responded by pursuing strategies of divide and conquer, proxy warfare, tributes, and marriages.
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.
The monk Xuanzang, who lived in the 7th century CE, reports the existence of 10 Buddhist monasteries with 2,000 monks who belonged to the Sarvastivada school of Buddhism in the area around Yanqi. In 644 CE, the Tang Dynasty invaded and annexed Yanqi during their wars against the Western Turks, a conflict that would last until the Turks were defeated in 657 CE. Tang control of the kingdom was re-established in 648 CE when a Tang general defeated a usurper who had deposed the puppet ruler that the Tang installed four years before. In 719 CE, the Tang established one of the Four Garrisons of Anxi in Yanqi, the other garrisons were in Kucha, Kashgar, and Hotan. Aurel Stein hypothesized that the Buddhist temples of Qigexing were burned during an iconoclasm after Islam became the state religion of the Kara-Khanid Khanate.
After the official fall of the Tang dynasty in 907, some members of its ruling house of Li managed to find refuge in the south of China, where their descendants founded the Southern Tang dynasty in the year 937. This dynasty continued many of the traditions of the former great Tang dynasty, including poetry, until its official fall in 975, when its ruler, Li Yu, was taken into captivity. Importantly for the history of poetry, Li survived another three years as a prisoner of the Song dynasty, and during this time composed some of his best known works. Thus, including this "afterglow of the T'ang dynasty", the final date for the Tang Poetry era can be considered to be at the death of Li Yu, in 978.
The English language version states that this movie is set in the "Tang dynasty" in the year 928. The Chinese version doesn't specify a time period. The film's published screenplay indicates it is set during Later Shu of the Five Dynasties and Ten Kingdoms period. Neither the Tang dynasty (618–907) nor Later Shu (934–965) existed in the year 928, although another state named "Tang" — known as Later Tang in history — was, as well as other Chinese states Wu, Chu, Min, Southern Han, Jingnan and Wuyue, in addition to the Khitan-ruled Liao dynasty (known as just Khitan in 928). However, Later Tang rulers were known as "Emperor" (皇帝) and never "King" (大王), and of all the states mentioned above, only Chu, Wuyue, Min and Jingnan rulers could be called "King" by their subjects in 928.
This is a timeline of the Tang dynasty, which covers a period of roughly 289 years, from 618, when the dynasty was founded, to 907, when the last Tang emperor was deposed by the warlord Zhu Wen, who established the Later Liang dynasty, inaugurating the period of Five Dynasties and Ten Kingdoms. Information on areas and events relevant to the Tang dynasty such as the Wu interregnum, when Wu Zetian established her own Zhou dynasty, and other realms such as the Sui dynasty, Tibetan Empire, Three Kingdoms of Korea, Nanzhao, Japan and steppe nomads are also included where necessary.
Turkic generals led many of the Tang Dynasty military campaigns that expanded the dynasty's territorial reach into Central Asia. In total, ten Turks were able to reach the highest military position of general. Ashina She'er, formerly the ruler of Beshbaliq and Kharakhoja between 630 and 635 and a member of the Ashina clan, was recruited as a Tang general in 635. He fought as a commander in a successful campaign against Karakhoja in 640. She'er was chosen as the general for the military expedition against Karasahr. The Tang loyalist that had been installed as ruler after the first invasion of Karasahr in 644 by Chinese general Guo Xiaoke was deposed by his cousin in a revolt. The usurper was executed after the rebellion was suppressed, and Tang governance returned to the oasis state. She'er continued onward to the nearby kingdom of Kucha, a state that had supported Karasahr during its war against the Tang.
Tang (; – 1646 BC) or Cheng Tang (成湯), recorded on oracle bones as Da Yi (大乙), was the first king of the Shang dynasty in Chinese history. He overthrew Jie, the last ruler of the Xia dynasty.
The Tang dynasty (; ) 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. Historians generally regard the Tang as a high point in Chinese civilization, and a golden age of cosmopolitan culture. Tang territory, acquired through the military campaigns of its early rulers, rivaled that of the Han dynasty. The Tang capital at Chang'an (present-day Xi'an) was the most populous city in the world in its day.
The "Shu Jing" chapter ""Tang Shi"" (湯誓 "Tang's Speech") illustrates how early Zhou texts used "tian" "heaven; god" in contexts with "shangdi" "god". According to tradition, Tang of Shang assembled his subjects to overthrow King Jie of Xia, the infamous last ruler of the Xia Dynasty, but they were reluctant to attack.
The last ruler of the Shunga dynasty, Devabhuti, was overthrown by his minister Vasudeva, who founded the Kanva dynasty in 75 BC. The Kanva ruler allowed the kings of the Shunga dynasty to continue to rule in obscurity in a corner of their former dominions. There were four Kanva rulers. According to the Puranas, their dynasty was brought to an end by the Satavahanas.
The Tang dynasty was another golden age, beginning in the ruins of the Sui. By 630, the Tang had conquered the powerful Gokturk Khagnate, preventing threats to China's borders for more than a century. A series of strong and efficient rulers, beginning with the founder and including a woman, expanded the Tang Empire to the point that it rivalled the later Yuan, Ming and Qing. The Tang was a period of rapid economic growth and prosperity, seeing the beginnings of woodblock printing. Tang rulers issued large amounts of currency to facilitate trade and distributed land under the equal-field system. The population recovered to and then surpassed Han levels, reaching an estimated 80 million. Although the state weakened after the disastrous An Shi Rebellion, and withdrew from managing the economy in the 9th century, this withdrawal encouraged economic growth and helped China's economy to develop into the mercantile economy of the Song and Ming Dynasties.
In earlier times, only rulers had temple names, such as Taihao (太昊). Temple names were assigned sporadically from the Shang dynasty and regularly from the Tang dynasty. Some Han emperors had their temple names permanently removed by their descendants in 190 AD. Temple names are the usual way to refer to emperors from the Tang dynasty up to the Ming dynasty. For the Ming dynasty and Qing dynasty (from 1368 AD), era names are often used instead.
Yuwen Rong's family was from the Tang Dynasty capital Chang'an, and traced its ancestry to Yuwen Yidougui, the last chief of the Xianbei tribe Yuwen, which was destroyed by the Former Yan ruler Murong Huang. His great-grandfather Yuwen Bi (宇文弼) was a major general for Tang's predecessor Sui Dynasty, and Yuwen Rong's grandfather Yuwen Jie served as a chancellor during the reign of Emperor Gaozong of Tang. Yuwen Rong's father Yuwen Jiao (宇文嶠) served as a prefectural secretary general.
Tian Huaijian (田懷諫) (b. 802) was a general of the Chinese dynasty Tang Dynasty, who, in his childhood, briefly served as the ruler of Weibo Circuit (魏博, headquartered in modern Handan, Hebei), which had been held by his family for generations. The soldiers soon overthrew him and replaced him with his distant relative Tian Xing, and he was delivered to the Tang capital Chang'an.
The Later Liang dynasty was founded by Zhu Wen. Zhu Wen was originally a rebel during the Huang Chao rebellion but later surrendered to the Tang dynasty and served under the military commander Li Keyong. In 904, Zhu Wen kidnapped Emperor Zhaozong of Tang, took him to Luoyang, and killed him. Three years later he also disposed of Emperor Ai of Tang, ending the Tang dynasty, and proclaimed his own dynasty of Liang. Zhu Wen undertook several military campaigns and failed in all of them. Despite lowering taxes to win support of the common folk, he is remembered in history as a brutal and ruthless tyrant. Zhu Wen was killed by his own son in 912, who was in turn killed by his brother a year later. The last ruler of Later Liang, Zhu Youzhen, ruled until 923 when Li Keyong's son Li Cunxu conquered the Liang capital Kaifeng.
Posthumous names are the conventional way of referring to rulers from the Zhou dynasty to the Sui dynasty. In the Zhou dynasty the posthumous name was usually only one character, such as "Wen" (cultured) or "Wu" (martial). However, as time went on rulers began to add more and more characters to the posthumous names of their ancestors. By the time of the first emperor of Tang the length had grown to 7 characters, which was taxing to pronounce or write. Therefore, emperors from Tang on are commonly referred to by either their temple name (Tang through Yuan dynasties) or era name (Ming and Qing dynasties), both of which are always just two characters long and therefore easy to remember and use.
The Tang dynasty emperors claimed to be patrilineally descended from the ancient philosopher Laozi (whose personal name was Li Dan or Li Er), the Han dynasty General Li Guang, and Western Liang ruler Li Gao. The Yenisei Kirghiz khagans claimed to be descended from Li Ling, who was a grandson of Li Guang, and therefore claimed to be related to the Tang dynasty emperors. This family was known as the Longxi Li lineage (隴西李氏) which includes Li Bai.
Li was the imperial surname of the Tang dynasty, founded by Li Yuan in 618 AD. One of the most prosperous and influential dynasties in Chinese history, Tang was ruled by 20 emperors surnamed Li. The Tang dynasty imperial family belonged to the northwest military aristocracy prevalent during the Sui dynasty and claimed to be paternally descended from Laozi, the Qin general Li Xin, the Han dynasty general Li Guang, and Western Liang ruler Li Gao.