In the 1860s great changes occurred in China and Altishahr that eventually end the Āfāqī Khoja holy war.

As the decade of the 1860s opens, the Qing economy and military were continuing to be strained by two major internal revolutions, the Taiping Rebellion and the Nian Rebellion.
Both of these revolutions had been on-going for nearly ten years and had forced the Qing to reduce their logistical support and military strength in Altishahr.

Added to the instability in China, fighting between the Dungans and the Han Chinese broke out in the summer of 1862 in the central Chinese Province of Shensi.
The fighting grew and became known over time as the Dungan Revolt.
As the Qing brought the Taiping army to Shensi to deal with the rebels, the authorities suggested that the Han organize formal militia units to protect themselves.
Afraid that the Dungans would ally with the Taiping army against them, the Han militias began to slaughter the Dungans.

The Dungan Revolt rapidly spread throughout Shensi and Kansu provinces.
The Qing were not able to get control of the situation in central China until 1864 after the arrival of To-lung-a as the imperial commissioner and military leader.
By March 1864, To-lung-a had recaptured most of Shensi province forcing the Dungan militias west into Kansu.

As the Dungan Revolt took place, the Qing worried about the repercussions in Altishahr and ultimately they issued orders to disarm the Dungan soldiers in the Qing army and to execute suspicious individuals.
 Concerned about such actions and attempting to rally support, the Dungans fighting the Qing in the rebellion issued warnings of an impending Qing massacre of Muslims throughout China.

Such warnings spread west to Altishahr and were responsible among other grievances for the start of a Muslim rebellion that began in June 1864 when a group of Dungans in the small town of Kucha set fire to a marketplace and began killing those whom they considered infidels.
The violence escalated and others Muslims joined in the rebellion.
The small Qing garrison attempted to stop the violence but was defeated.

By the end of June, armed attacks against the Qing authorities in Yarkand and Kashghar had begun.
By the end of July similar rebellions had started in Aqsu, Urumchi, and Ush Turfan.

Although the revolts in each case were initiated by the Dungans, other Muslims were quick to join the rebellion.
Even though the Dungan Revolt was not a war of religion, the revolt in Altishahr that was ignited by the Dungans grew into a holy war.
In Altishahr, individuals of different ethnicities, tribal affiliations, social backgrounds and classes united as Muslims and rebelled against the Qing regime.
The motivations of the Altishahr revolutionaries differed in many cases but beginning at this time in 1864 virtually the entire Muslim population in Altishahr stood together against the infidel Qing rule.
As so, the 1864 rebellion which started as a Dungan revolt led to a general widespread Muslim rebellion.

As the Dungans and their Turkic Muslim allies fought for control of the city of Kashghar, requests for aid were made to the ruler of Khoqand, ‘Ālim Quli, and to the Āfāqī Khoja.
In response, an expedition led by the renown Khoqandi military commander Ya‘qūb Beg was sent from Khoqand to Kashghar in late 1864.
Included as a member of the small force sent to Kashghar was Buzurg Khan, the son of famed Āfāqī leader Jāhangīr Khoja.

Over the next eight months, Ya‘qūb Beg led a coalition of Kyrgyz and Qipchaq tribesmen along with Badakhshi mountaineers and captured Kashghar, Yangihissar, and Yarkand.
By the spring of 1866, Ya‘qūb Beg had consolidated his powerbase and overcome Āfāqī khoja challenges from Wālī Khān and Buzurg Khan effectively ending the Āfāqī khoja holy war for Altishahr.

Ya‘qūb Beg went on first to capture Khotan and Kucha in 1867 and then Urumchi and Ush Turfan by the end of 1870.
The Qing were expelled from Central Asia and Ya‘qūb Beg ruled an independent Muslim state consisting of the entirety of Altishahr until 1877 when Qing General Zuo Zongtang completed the rec
In the 1860s great changes occurred in China and Altishahr that eventually end the Āfāqī Khoja holy war.
As the decade of the 1860s opens, the Qing economy and military were continuing to be strained by two major internal revolutions, the Taiping Rebellion and the Nian Rebellion. Both of these revolutions had been on-going for nearly ten years and had forced the Qing to reduce their logistical support and military strength in Altishahr.
Added to the instability in China, fighting between the Dungans and the Han Chinese broke out in the summer of 1862 in the central Chinese Province of Shensi. The fighting grew and became known over time as the Dungan Revolt. As the Qing brought the Taiping army to Shensi to deal with the rebels, the authorities suggested that the Han organize formal militia units to protect themselves. Afraid that the Dungans would ally with the Taiping army against them, the Han militias began to slaughter the Dungans.
The Dungan Revolt rapidly spread throughout Shensi and Kansu provinces. The Qing were not able to get control of the situation in central China until 1864 after the arrival of To-lung-a as the imperial commissioner and military leader. By March 1864, To-lung-a had recaptured most of Shensi province forcing the Dungan militias west into Kansu.
As the Dungan Revolt took place, the Qing worried about the repercussions in Altishahr and ultimately they issued orders to disarm the Dungan soldiers in the Qing army and to execute suspicious individuals.  Concerned about such actions and attempting to rally support, the Dungans fighting the Qing in the rebellion issued warnings of an impending Qing massacre of Muslims throughout China.
Such warnings spread west to Altishahr and were responsible among other grievances for the start of a Muslim rebellion that began in June 1864 when a group of Dungans in the small town of Kucha set fire to a marketplace and began killing those whom they considered infidels. The violence escalated and others Muslims joined in the rebellion. The small Qing garrison attempted to stop the violence but was defeated.
By the end of June, armed attacks against the Qing authorities in Yarkand and Kashghar had begun. By the end of July similar rebellions had started in Aqsu, Urumchi, and Ush Turfan.
Although the revolts in each case were initiated by the Dungans, other Muslims were quick to join the rebellion. Even though the Dungan Revolt was not a war of religion, the revolt in Altishahr that was ignited by the Dungans grew into a holy war. In Altishahr, individuals of different ethnicities, tribal affiliations, social backgrounds and classes united as Muslims and rebelled against the Qing regime. The motivations of the Altishahr revolutionaries differed in many cases but beginning at this time in 1864 virtually the entire Muslim population in Altishahr stood together against the infidel Qing rule. As so, the 1864 rebellion which started as a Dungan revolt led to a general widespread Muslim rebellion.
As the Dungans and their Turkic Muslim allies fought for control of the city of Kashghar, requests for aid were made to the ruler of Khoqand, ‘Ālim Quli, and to the Āfāqī Khoja. In response, an expedition led by the renown Khoqandi military commander Ya‘qūb Beg was sent from Khoqand to Kashghar in late 1864. Included as a member of the small force sent to Kashghar was Buzurg Khan, the son of famed Āfāqī leader Jāhangīr Khoja.
Over the next eight months, Ya‘qūb Beg led a coalition of Kyrgyz and Qipchaq tribesmen along with Badakhshi mountaineers and captured Kashghar, Yangihissar, and Yarkand. By the spring of 1866, Ya‘qūb Beg had consolidated his powerbase and overcome Āfāqī khoja challenges from Wālī Khān and Buzurg Khan effectively ending the Āfāqī khoja holy war for Altishahr.
Ya‘qūb Beg went on first to capture Khotan and Kucha in 1867 and then Urumchi and Ush Turfan by the end of 1870. The Qing were expelled from Central Asia and Ya‘qūb Beg ruled an independent Muslim state consisting of the entirety of Altishahr until 1877 when Qing General Zuo Zongtang completed the rec
Āfāqī Khoja Holy War