The Tibetan "desi" (regent) Sangye Gyatso concealed the death of the 5th Dalai Lama in 1682, and only informed the emperor in 1697. He moreover kept relations with Dzungar enemies of the Qing. All this evoked the great displeasure of the Kangxi Emperor. Eventually Sangye Gyatso was toppled and killed by the Khoshut ruler Lha-bzang Khan in 1705. As a reward for ridding him of his old enemy the Dalai Lama, the Kangxi Emperor appointed Lha-bzang Khan Regent of Tibet (). The Dzungar Khanate, a confederation of Oirat tribes based in parts of what is now Xinjiang, continued to threaten the Qing Empire and invaded Tibet in 1717. They took control of Lhasa with a 6,000 strong army and killed Lha-bzang Khan. The Dzungars held on to the city for three years and at the Battle of the Salween River defeated a Qing army sent to the region in 1718. The Qing did not take control of Lhasa until 1720, when the Kangxi Emperor sent a larger expedition force there to defeat the Dzungars.