section_path: History/Establishment
section_name: Establishment
paragraph_text: Establishment
  
  The Li family 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, and it included the prominent Tang poet Li Bai. Aside from traditional historiography, some modern historians have suggested that the Tang imperial family might have modified its genealogy to conceal Xianbei heritage. The Tang emperors had part- Xianbei maternal ancestry, from Emperor Gaozu of Tang 's part-Xianbei mother, Duchess Dugu.
  
  Li Yuan, the founder of the Tang dynasty, was Duke of Tang and governor of Taiyuan, the capital of modern Shanxi, during the collapse of the Sui dynasty. He 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 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 years old, 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 favor 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, and 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 CE.
  
  The Tang dynasty further led the Tang campaigns against the Western Turks. Early military conflicts were a result of the Tang interventions in the rivalry between the 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 Qaghan Ashina Helu in 657 CE.
  
  Around that time, the Tang court enjoyed the visit of numerous dignitaries from foreign lands. These were portraited in The Gathering of Kings (王會圖; Wánghuìtú), probably painted by Yan Liben (601–673 CE). From right to left are representatives hailing from Lu (魯國)—a reference to the Eastern Wei — Rouran (芮芮國), Persia (波斯國), Baekje (百濟國), Kumedh (胡密丹), Baiti (白題國), Mohe people (靺國), Central India (中天竺), Sri Lanka (獅子國), Northern India (北天竺), Tashkurgan (謁盤陀), Wuxing of the Chouchi ((武興國), Kucha ((龜茲國), Japan (倭國), Goguryeo (高麗國), Khotan (于闐國), Silla (新羅國), Dangchang (宕昌國), Langkasuka (狼牙修), Dengzhi (鄧至國), Yarkand (周古柯), Kabadiyan (阿跋檀), the "Barbarians of Jianping" (建平蠻), and Nudan (女蜑國).