In 746, the fifth year of the Tianbao era under Emperor Xuanzong of Tang, Wang Zhongsi, military governor of Hexi, died suddenly in exile, leaving a power vacuum on the northwestern frontier. Seizing the opportunity, the Tibetan ruler Tride Tsuktsen allied with the Turks, Tuyuhun, and other tribes, massing two hundred thousand troops beyond Yumen Pass. At court, Li Linfu and Yang Guozhong were locked in an increasingly fierce struggle for power, while supplies to the frontier army had been cut off. The Hexi Corridor teetered on the brink of collapse.