Emperor Taizong's campaign against Tufan

Emperor Taizong of Tang (r. 626-649), the second emperor of Chinese dynasty Tang Dynasty, subjugated the Xianbei state Tuyuhun in 635. Thereafter, Tuyuhun's southwestern neighbor, the Tibetan state Tufan, rose in power and soon displaced Tuyuhun as the major threat to Tang's west. In 638, in retaliation to Emperor Taizong's refusal to give him a Tang princess in marriage, Tufan's Songtsän Gampo, believing that the refusal was due to Tuyuhun interference, attacked Tuyuhun and Tang with a grand force of 200,000, and while Tang's 50,000 forces, commanded by Niu Jinda (牛進達), serving under Hou Junji, repelled the Tufan attack, Emperor Taizong decided to placate Songtsän Gampo by giving him a distant niece, Princess Wencheng, in marriage. For the rest of Emperor Taizong's reign, there would be no further major battles between Tang and Tufan, although Tufan would pose major military threats for almost the rest of Tang Dynasty.

Initial contacts between Tang and Tufan
The existence of Tufan was unknown to the Chinese until 634, when Tufan's ruler Songtsän Gampo sent emissaries with tributes to China's Tang Dynasty and requested that he be allowed to marry a Tang princess. Emperor Taizong of Tang, who was then battling Tufan's neighbor Tuyuhun, situated between Tang and Tufan, did not initially respond to Songtsän Gampo's marriage overture but did sent the emissary Feng Dexia (馮德遐) to Tufan to establish peaceful relations.

Conflict in 638
Meanwhile, in late 634, Emperor Taizong had sent the general Li Jing against Tuyuhun and, in a major campaign, overpowered Tuyuhun's Busabo Khan Murong Fuyun, who was killed in flight. Tang thereafter created Murong Fuyun's son Murong Shun as Tuyuhun's khan and, after Murong Shun was assassinated late in 635, supported Murong Shun's son Murong Nuohebo as khan.

Feng Dexia appeared to have gotten to Tufan around the same time. By this time, Songtsän Gampo had known that, in the past, Eastern Tujue and Tuyuhun khans had married Chinese princesses, and therefore sent an emissary to accompany Feng back to Tang with further tributes and requesting to marry a Tang princess. Emperor Taizong refused. When the Tufan emissary returned to Tufan, he informed Songtsän Gampo that Emperor Taizong had initially agreed to the marriage proposal, but that Murong Nuohebo had visited Tang and was interfering, leading to Emperor Taizong's refusal. Songtsän Gampo, believing in the report, attacked Tuyuhun in anger, capturing much of the Tuyuhun people and forcing the rest to flee north of the Qinghai Lake.

Meanwhile, in fall 638, Tufan forces, numbering some 200,000 and apparently commanded by Songtsän Gampo himself, began attacking Tang itself, first attacking Song Prefecture (松州, roughly modern Ngawa Tibetan and Qiang Autonomous Prefecture, Sichuan) -- but meanwhile sending emissaries to the Tang capital Chang'an, again offering tributes and declaring that they were intending to welcome a princess. Emperor Taizong responded by commissioning the general Hou Junji to command an army, assisted by the generals Zhishi Sili (執失思力), Niu Jinda, and Liu Jian (劉簡). Meanwhile, Tufan forces were putting Song Prefecture's capital under siege, but Tang advance forces, commanded by Niu, surprised them and defeated them. In fear, Songtsän Gampo withdrew and sent emissaries to Chang'an to apologize -- but to again request marriage. Emperor Taizong agreed this time.

Marriage between Songtsän Gampo and Princess Wencheng
However, no further action was taken to carry out the marriage for about two years. In fall 640, Songtsän Gampo sent his prime minister Lu Dongzan (祿東贊) to Tang to offer tributes of gold and jewels, again requesting marriage. In response, Emperor Taizong created a daughter of a clansman the Princess Wencheng, preparing to give her to Songtsän Gampo in marriage. Impressed by Lu Dongzan's propriety in interacting with him, he also, over Lu Dongzan's own objection -- that he already had a wife and that it would be inappropriate for him to marry before his king -- gave Lady Duan, the granddaughter of Princess Langye, to Lu Dongzan as a wife as well.

In spring 641, Emperor Taizong sent his cousin, Li Daozong the Prince of Jiangxia, to accompany Lu Dongzan back to Tufan and to escort Princess Wencheng. When they arrived in Tufan, Songtsän Gampo was said to be so pleased that he bowed to Li Daozong, using ceremony appropriate for a son-in-law toward a father-in-law. He built a palace for Princess Wencheng and changed into Chinese clothing before he met her. It was said that at that time, the Tufan people had a custom that Princess Wencheng hated -- that people would paint their faces red -- and that he prohibited the custom for her sake.

Other points
Thanks to another side of the agreement, he also sent nobles and family members to Chang'an to study at Tang's imperial university. In an old custom which make this people are de facto use as hostages by Tang, while they also learn Chinese custom and culture for better future relationships. Songtsän Gampo also requested Chinese scholars. Early in Gaozong's reign, Tibet also requested technology transfers for sericulture, wine-brewing, grain mills and paper industries.

For the rest of Emperor Taizong's reign, there would be no further records of conflicts with Tufan. In 647, for example, when Tang forces attacked the Xiyu state Qiuzi (龜茲)'s king Bai Helibushibi (白訶黎布失畢), Emperor Taizong requisitioned Tufan troops. Moreover, in 648, when the Tang emissary Wang Xuance became stuck in political turmoil of an Indian state, he sought aid from both Tufan and Nepal and received aid from both in helping to defeat one of the factions (649). There would not be a conflict between Tang and Tufan until 662, a dozen years after both Emperor Taizong and Songtsän Gampo had died.