In 639, Songtsen Gampo of the Tibetan Empire personally led an army against Songzhou (Songpan). The neighboring prefectures of Kuazhou and Nuozhou defected to the Tibetan side. Songzhou's governor attacked the Tibetans but lost. The Tang court dispatched 50,000 soldiers under Hou Junji to relieve Songzhou. Hou attacked Songtsen Gampo's camp at night, killing some 1,000 Tibetan soldiers. Songtsen Gampo called off the campaign and sent an envoy to Songzhou to apologize. However he insisted to a marriage alliance, to which Emperor Taizong of Tang agreed to in 640.
