Li Shimin, the future Emperor Taizong of Tang, ambushes and kills his rival brothers Li Yuanji and Li Jiancheng in the Xuanwu Gate Incident.
The Xuanwu Gate Incident was a palace coup for the throne of the Tang dynasty on 2 July 626, when Prince Li Shimin (Prince of Qin) and his followers assassinated Crown Prince Li Jiancheng and Prince Li Yuanji (Prince of Qi). Li Shimin, the second son of Emperor Gaozu, was in an intense rivalry with his elder brother Li Jiancheng and younger brother Li Yuanji. He took control and set up an ambush at Xuanwu Gate, the northern gate leading to the Palace City of the imperial capital Chang'an. There, Li Jiancheng and Li Yuanji were murdered by Li Shimin and his men. Within three days after the coup, Li Shimin was installed as the crown prince. Emperor Gaozu abdicated another sixty days later and passed the throne to Li Shimin, who would become known as Emperor Taizong.
Emperor Taizong of Tang (28 January 598 – 10 July 649), previously Prince of Qin, personal name Li Shimin, was the second emperor of the Tang dynasty of China, ruling from 626 to 649. He is traditionally regarded as a co-founder of the dynasty for his role in encouraging Li Yuan, his father, to rebel against the Sui dynasty at Jinyang in 617. Taizong subsequently played a pivotal role in defeating several of the dynasty's most dangerous opponents and solidifying its rule over China.Taizong is considered to be one of the greatest emperors in China's history and henceforth, his reign became regarded as the exemplary model against which all future emperors were measured. His era, the "Reign of Zhenguan (Chinese: 貞觀之治; pinyin: Zhēnguàn Zhī Zhì)" is considered a golden age in ancient Chinese history and was treated as required studying material for future crown princes. Taizong continued to develop imperial examination systems. He asked his officers to become loyal to the policies not people, in order to eliminate corruption. Under the Zhenguan era, Tang China flourished economically and militarily. For more than a century after his death, China enjoyed prosperity and peace brought about by the solidification of imperial protection over the Chinese regions. In territorial extent, it covered most of the territories previously held by the Han dynasty and parts of modern Korea, Vietnam, Xinjiang, and Central Asian regions. This era of consolidation and conquest laid the foundation for Xuanzong's reign, which is considered to be the height of the Tang dynasty.
In 630, Emperor Taizong sent his general Li Jing against the Eastern Turks, defeating and capturing their Jiali Khan Ashina Duobi and destroying their power. This made Tang the dominant power in East and Central Asia, and Emperor Taizong subsequently took the title of Tengeri Qaghan (Chinese: 天可汗; pinyin: Tiān Kěhán; Wade–Giles: T'ien K'ehan, "Tenger Khan" or the God like Emperor). He also launched a series of campaigns against the oasis states of the Tarim Basin, and against the armies of their main ally, the Western Turks. During his reign, Tang armies annexed Karakhoja in 640, Karasahr in 644 and Kucha in 648. Eventually, the Tang defeated and annexed the Western Gokturk khaganate after Su Dingfang defeated Qaghan Ashina Helu in 657.
Unlike much of the nobility in his time, Emperor Taizong was a frank rationalist and scholar of logic and scientific reason, openly scorning superstitions and claims of signs from the heavens. He also modified important rites in order to ease the burden of agricultural labour. The modern Chinese historian Bo Yang opined that Emperor Taizong achieved greatness by enduring criticism which others would find difficult to accept whilst trying hard not to abuse his absolute power (using Emperor Yang of Sui as a negative example), as well as through his employment of capable chancellors such as Fang Xuanling, Du Ruhui and Wei Zheng. Emperor Taizong's wife Empress Zhangsun also proved to be a capable assistant.