Emperor Taizong's campaign against Tuyuhun

Emperor Taizong of Tang (r. 626–649), the second emperor of the Tang dynasty faced challenges throughout his reign from Tang's western neighbor, the state of Tuyuhun, whose Busabuo Khan Murong Fuyun constantly challenged Tang authority in the border regions. In 634, Emperor Taizong launched a major attack, commanded by the major general Li Jing, against Tuyuhun, dealing Tuyuhun forces heavy defeats and causing Murong Fuyun's subordinates to assassinate him in 635. Tuyuhun, thus weakened, no longer remained a major power in the region, and while Tang, ironically, played the role of protector for Murong Fuyun's son, the Gandou Khan Murong Shun, and grandson, the Ledou Khan Murong Nuohebo, Tuyuhun was never able to recover, particularly with its southwestern neighbor, the Tibetan Empire, constantly attacking it. By 672, during the reign of Emperor Taizong's son Emperor Gaozong of Tang, Tang was forced to move Tuyuhun remnants into its own territory, ending Tuyuhun.

During Murong Fuyun's reign
Throughout the reign of Emperor Taizong's father Emperor Gaozu, there were repeated cycles of Tuyuhun, then ruled by the Busabo Khan Murong Fuyun, making incursions into the modern Sichuan and southern Gansu regions and offers of peace by both sides, never longstanding. These incursions continued after Emperor Taizong became emperor in 626—although they appeared to decrease in frequency, as the only incursions recorded in the Chinese chronicle Zizhi Tongjian were in 628, when Tuyuhun forces attacked Min Prefecture (岷州, roughly modern Dingxi, Gansu), and 632, when Tuyuhun forces attacked Lan Prefecture (蘭州, roughly modern Lanzhou, Gansu). It was said that, with regard to Tuyuhun's generally hostile attitude toward Tang, that Murong Fuyun had, in his old age (although it is not known what his age was at this point), taken the posture at the advice of his strategist, the Prince of Tianzhu.

Sometime before 634, Murong Fuyun appeared to make an overture toward peace—by sending an emissary to offer tributes to Emperor Taizong—but even before the emissary left, Tuyuhun forces attacked and pillaged Shan Prefecture (鄯州, in modern Haidong Prefecture, Qinghai). When Emperor Taizong sent emissaries to rebuke Murong Fuyun and summoned Murong Fuyun to Chang'an to meet him, Murong Fuyun refused, but responded by requesting that a Tang princess be given to his son, the Prince of Zun, in marriage. Emperor Taizong agreed, but ordered that the Prince of Zun personally arrive in Chang'an to marry the princess. When the Prince of Zun failed to do so, Emperor Taizong cancelled the marriage. Meanwhile, Murong Fuyun also attacked Lan and Kuo (廓州, also in modern Haidong) Prefectures and detained the Tang emissary Zhao Dekai (趙德楷). Emperor Taizong sent a number of emissaries to Tuyuhun to discuss the matter and also summoned Tuyuhun emissaries and personally had discussions with them. Murong Fuyun still did not relent.

In fall 634, Emperor Taizong sent the generals Duan Zhixuan (段志玄) and Fan Xing (樊興) to attack Tuyuhun with Tang forces, supplemented by soldiers from the Qibi (契苾) and Dangxiang tribes. When Duan began the attack, however, after minor successes, Tuyuhun forces simply began to elude him and refuse to engage him. Apparently immediately after he withdrew, Tuyuhun forces again attacked Liang Prefecture (涼州, roughly modern Wuwei, Gansu).

In 634 the Tibetans asked the Tang dynasty for a Tang princess to marry their king. When they discovered that the Tuyuhun had an envoy in the capital at the same time also asking for the hand of a Tang princess, they attacked the Tuyuhun forcing its king to flee. After further struggles between the Tang dynasty and the Tibetan Empire, the former finally agreed to send a princess to the latter.

Li Jing's campaign
After the Tuyuhun attack on Liang Prefecture, Emperor Taizong decreed that a major campaign against Tuyuhun shall be carried out. He wanted to make the general Li Jing his commander, but felt that Li Jing was getting advanced in age (63 at the time), and initially decided not to do so. However, when Li Jing heard this, he requested to go, which pleased Emperor Taizong, who made him the commander of the overall operation, with Hou Junji, Li Daozong, Li Daliang, Li Daoyan (李道彥), and Gao Zengsheng (高甑生) serving under him, supplemented by Tujue and Qibi troops. In the initial stage of the campaign, some Dangxiang and Qiang tribes, apparently fearing that they would be involved, rebelled against Tang and fled to join Tuyuhun.

In summer 635, Tang forces began engaging Tuyuhun forces, and after some minor victories by Li Daozong, Murong Fuyun, apparently following the same strategies he used against Duan, burned the grasses and fled. Most of Li Jing's subordinates believed that it was dangerous to venture further without adequate grazing supplies and advised withdrawal, but Hou opposed the idea, pointing out that this was the opportunity to destroy Tuyuhun. Li Jing agreed, and divided his forces into two branches—with Li Jing himself, Xue Wanjun (薛萬均) and Li Daliang heading northwest, and Hou and Li Daozong heading southwest. Both prongs continued to be successful, although during one battle Xue Wanjun and his brother Xue Wanche (薛萬徹) fell into a Tuyuhun trap and were nearly killed, saved only by the heroics of Qibi Heli (契苾何力). Eventually, Li Jing received news of Murong Fuyun's location and surprised Murong Fuyun, defeating his remaining forces. Murong Fuyun himself managed to flee, but the nobles, led by his son Murong Shun the Prince of Daning—who, as Murong Fuyun's oldest son by his wife, the Sui dynasty's Princess Guanghua, had been resentful at not being made crown prince—killed the Prince of Tainzhu and surrendered. Murong Fuyun, in flight, was killed by his subordinates. Emperor Taizong created Murong Shun the dual titles of Prince of Xiping and Zhugulüwugandou Khan (or Gandou Khan in short), to succeed Murong Fuyun.

During Murong Shun's and Murong Nuohebo's reigns
Murong Shun's reign was short—plagued by the people's lack of respect for him, because he had long served as a hostage to Sui. In winter 635, he was assassinated. His son Murong Nuohebo the Prince of Yan succeeded him, and there was much infighting. Emperor Taizong sent Hou Junji to Tuyuhun with an army to pacify the Tuyuhun people so that they would submit to Murong Nuohebo's rule. In 636, Murong Nuohebo petitioned to formally submit to Tang, and Emperor Taizong created him the dual titles of Prince of Heyuan and Wudiyebaledou Khan (or Ledou Khan in short).

Tuyuhun, however, was soon under the threat of the emerging power of the Tibetan Empire. Sometime before 638, the Tibetan leader Songtsen Gampo, who had heard that Eastern Tujue's and Tuyuhun's khans had been able to marry Tang princesses, also wanted to marry one, sending emissaries to offer tributes of gold, silver, and jewelry as bride price. Emperor Taizong refused, and when the emissary returned to Tibet, he blamed Murong Nuohebo for alienating Emperor Taizong from a marriage alliance with Tibet. Songtsen Gampo, believing the emissary, attacked Tuyuhun, forcing the Tuyuhun people to flee north of the Qinghai Lake. Songtsen Gampo next attacked Songzhou, a Tang frontier city (in modern Ngawa Tibetan and Qiang Autonomous Prefecture, Sichuan), claiming that he was "welcoming" the Tang princess. In 638, a counterattack by the Tang general Niu Jinda (牛進達), under Hou's command, defeated Tibetan forces at Song Prefecture. Songtsen Gampo submitted a formal apology to Emperor Taizong, but still requested to marry a Tang princess, and this time Emperor Taizong agreed, eventually creating a daughter of a clansman as Princess Wencheng and marrying her to Songtsen Gampo in 640—but, prior to that, creating another daughter of a clansman as Princess Honghua and marrying her to Murong Nuohebo in 639, when Murong Nuohebo visited the Tang capital Chang'an.

However, soon the control of the Tuyuhun state fell under the chancellor the Prince of Xuan. It was rumored that the Prince of Xuan intended to seize Princess Honghua and then turn her and Murong Nuohebo to Tibet. In 641, when Murong Nuohebo heard this, he fled to Shanshan to his general the Prince of Weixin. Meanwhile, the Tang military commander Xi Junmai (席君買) made a surprise attack against the Prince of Xuan, killing him and his two brothers, allowing Murong Nuohebo to return, albeit with the Tuyuhun people highly alarmed. Emperor Taizong sent his official Tang Jian (唐儉) to Tuyuhun to try to pacify the people.

Final collapse of the Tuyuhun
Little is known about Murong Nuohebo's governance for years after this incident. In 660—more than a decade after Emperor Taizong had died in 649 and been succeeded by his son Emperor Gaozong—Tibet's then-chancellor Gar Tongtsen Yülsung (Lu Dongzan, 祿東贊) sent his son Trinring Tsendro (Qizheng, 起政) to attack Tuyuhun on account of Tuyuhun's status as Tang vassal, although the results of the attack were not mentioned in Chinese historical sources, but the attacks appeared to recurrent. Both Tuyuhun and Tibet submitted petitions to Emperor Gaozong accusing each other of crimes and requesting aid, and Emperor Gaozong declined both. In 663, when the Tuyuhun official Suhe Gui (素和貴) surrendered to Tibet, he gave much details about Tuyuhun to Tibet, and a subsequent Tibetan attack dealt devastating losses to Tuyuhun. Murong Nuohebo and Princess Honghua abandoned their territory and fled to Liang Prefecture with his remaining followers, largely ending the existence of Tuyuhun as a separate state, although the Tuyuhun people would not be formally adopted into the Tang governmental structure until 672, when Murong Nuohebo was given a prefect title in a newly created Anle Prefecture (安樂州, in modern Wuzhong, Ningxia).