張格爾
Kashgaria was able to be free of Qing control during an invasion by Jahangir Khoja who had invaded from Kokand, which lasted from 1820–1828. The oases of Kashgar and Yarkand were not recaptured by the Qing until 1828, after a three-year campaign. Hui Muslim merchants helped the Qing fight off Jahangir Khoja and his Turkic Kokandi invaders. The Uyghur Muslim Sayyid and Naqshbandi Sufi rebel of the Afaqi suborder, Jahangir Khoja was sliced to death (Lingchi) in 1828 by the Manchus for leading a rebellion against the Qing. In Kashgaria, this was followed by another invasion in 1829 by Mahommed Ali Khan and Yusuf Khoja, the brother of Jahangir. In 1846, a new Khoja revolt in Kashgar under Kath Tora led to his accession to rulership of Kashgar as an authoritarian ruler. His reign, however, was brief, for at the end of seventy-five days, on the approach of the Chinese, he fled back to Kokand amid the jeers of the inhabitants.