In 1038 he declared himself the emperor of the Western Xia Dynasty whose capital was situated in Xingqing. Afterwards, he launched a campaign against the Song. Although the Tangut empire won a series of three large battles, the victories proved to be very costly and they found their forces depleted, due in part to a scorched earth policy by the Song. In 1044 the Tangut Empire signed a treaty with the Song dynasty resulting in the nominal acknowledgment of Song sovereignty by the Tangut and the payment of tribute by the Song.