張格爾
As a result of the Dungan Revolt (1862–77), by 1864 the Chinese held only the citadels of Kashgar and a few other places. The Kyrgyz or Kazakh Sadic Beg entered Kashgar, was unable to take the citadel and sent to Tashkent for a Khoja to become ruler. Burzug Khan, the only surviving son of Jahangir Khoja, left Tashkent with 6 men, was joined by Yakub Beg, left Kokand with 68 men, crossed the frontier in January 1865, gained more supporters was soon installed on the throne of his ancestors. Sadic Beg revolted, was defeated by Yakub Beg and driven beyond the mountains. Yakub went southeast to Yarkand, the largest town in the region, and was driven out by an army from Kucha. He next besieged the Chinese at Yangi Hissar for 40 days and massacred the garrison. Sadic Beg reappeared, was defeated and talked into becoming an ally. Invaders from Badakshan were also talked into alliance. A Dungan force from Kucha and eastward arrived at Maralbeshi, was defeated and 1000 of the Dungans joined Yakub Beg. Yarkand now decided to submit to Burzug Khan and his great vizier. The Chinese in the Kashgar citadel now had no hope. In September 1865 the second in command and 3000 men surrendered, converted to Islam and joined Yakub Beg. The actual commander refused and blew himself up along with his family. (The commanders of Yarkand and Kulja had done the same.) An army of rebels from Kokand arrived and joined Yakub. Late in the year Burzug Khan and Yakub went to Yarkand to deal with a disturbance. The Dungan faction suborned Yakub's Dungans and he was reduced to a few hundred men. Burzug drew off to a separate camp, Yakub defeated the Dungans, Burzug Khan fled to Kashgar and declared Yakub a traitor. The religious leaders supported Yakub and Burzug was seized in his palace. He was confined for 18 months, was exiled to Tibet and later found his way to Kokand. In a little more than a year Yakub had become master of Kashgar, Yarkand and Maralbashi, roughly the western end of the Tarim Basin as far as the Yarkand River.