Afaqi Khoja revolts

In 1759, the Qing dynasty of China defeated the Dzungar Khanate and completed the conquest of Dzungaria. Concurrent with this conquest, the Qing occupied the Altishahr region in modern southern Xinjiang, which had been settled by Muslims who followed the political and religious leadership of Afaq Khoja.

After the Qing conquest, the Chinese began to incorporate Altishahr and the Tarim Basin into their empire. The territory along with Dzungaria came to be known as Xinjiang. Although the followers of Afaq Khoja known as the Āfāqī Khojas resisted Qing rule, their rebellion was put down and the khojas were removed from power.

Beginning at that time and lasting for approximately one hundred years, the Āfāqī Khojas waged numerous military campaigns in an effort to retake Altishahr from the Qing.

Khoja background and rivalries
The Khojas of Central Asia were a Naqshbandī Sufi lineage founded by Ahmad Kāsānī (1461-1542), known as Makhdūm-i-Azam or the "Great Master". After his death, the followers of Ahmad Kāsānī known as Makhdūmzādas, split into two factions, one led by Afaq Khoja and another by Ishāqi Khoja.

The region was under Yarkent Khanate up until late-1600s, at which point it was conquered by Dzungar Khanate. For the 80 years until the Qing conquest, these two khoja factions governed the Altishahr on behalf of Dzungar Khanate including the six major cities (Aqsu, Kashghar, Khotan, Ush Turfan, Yangihissar, and Yarkand) bordering the Tarim Basin. During these times, the two clans competed as rivals and generally treated each other with animosity.

At that time, the Altishahr region became part of a fragile Chinese frontier governed by Manchu governors and Turkestani officials including supporters of the Ishāqis. While some Āfāqī families remained in the conquered territory others relocated to Khoqand where they could hide, regroup, and strike back at the Qing. Khoqand, as so, would suddenly find itself involved in Āfāqī Khojas military expeditions aimed at the Chinese.

Conduct of the Qing
As a result, in 1765 when Sucheng commandeered 240 men to take official gifts to Peking, the enslaved porters and the townspeople revolted. ‘Abd Allah, Sucheng, the garrisoned Qing force and other Qing officials, were slaughtered and the rebels took command of the Qing fortress. In response to the revolt, the Qing brought a large force to the city and besieged the rebels in their compound for several months until they surrendered. The Qing then cruelly retaliated against the rebels by executing over 2,000 men and exiling some 8,000 women. This uprising is known today as the Ush rebellion.

Although the details of Bin-jing's crimes were suppressed to prevent further discord, the Muslim population during these times was quite aware and quite angered with the on-going fraternization that occurred between the Qing and Muslim women.

Jāhangīr and Khoqand (1825-1830)
Āfāqī Khoja challenge to Qing authority first emerged in 1797 when Sarimsaq, son of Burhān al-Dīn Khoja, attempted to launch a campaign to retake Kashghar but was stopped Narbuta Biy, the ruler of Khoqand.

Attacks on the Qing began in earnest approximately twenty years later in 1820. At that time, Jāhangīr Khoja, the son of Sarimsaq, proposed to the ruler of Khoqand, Umar Khan, that they join as allies and launch a holy war against the Qing. When the proposal was rejected by Umar Khan, Jāhangīr independently led some 300 soldiers on a raid to capture Kashghar. Jāhangīr's forces clashed with the Qing, but were forced to end the expedition even before reaching the gates of the Gulbagh fortress near Kashghar.

In 1825, Jāhangīr and his guerilla force ambushed and killed most every member of a small Chinese detachment. This small victory caused the local tribesmen to rally to Jāhangīr's support and shortly thereafter Jāhangīr attacked the city of Kashghar and executed the governor, a Turki. The Chinese force assigned to the area was too weak to stop the attack which expanded into a general revolt in the cities of Yangihissar, Yarkand, and Khotan where Chinese civilians caught outside the city walls were slain. When the khojas attacked, the Qing had the support of the Hui merchants along with the Ishāqi Khojas who opposed the "debauchery" and "pillage" of the Āfāqī under Jāhangīr.

Meanwhile, in Khoqand, the ruler, Madali Khan, watched the activities close to his border and made the decision to join the war in support of Jāhangīr in order to protect Khoqand trade and commerce in the region. When Jāhangīr asked for assistance in capturing the Gulbagh fortress, Madali Khan led a Khoqand army of 10,000 to Kashghar. After participating personally in the battle for 12 days, Madali Khan returned home but left part of the Khoqandian force in Jāhangīr's command. On August 27 after the Qing had exhausted their food supply, the Gulbagh fortress surrendered to Jāhangīr. That summer Jāhangīr also successfully captured Yangihissar, Yarkand, and Khotan.

The Qing responded in the spring of 1827 by sending an expeditionary force of more than 20,000 soldiers to combat the Āfāqī Khoja and by the end of March had recaptured all of their lost territory. Jāhangīr was captured and taken to Peking where he was ultimately executed by slicing (Lingchi). To protect and defend Altishahr from future attacks, the Qing increased troop levels in the territory, rebuilt the westernmost cities, and constructed stronger fortifications. Trade restrictions and boycotts were imposed against Khoqand for participating in the holy war and for allowing the Āfāqī to take refuge in Khoqand.

As such, Madali Khan supported the continuation of the holy war and allowed his highest military leaders, including Haqq Quli, the overall Commander of the army, to lead a large force against the Qing. Kashghar was easily occupied by September 1830 and the invaders immediately began a siege of the Gulbagh fortress. While the Khoqandians assaulted the Gulbagh fortress, Yusuf Khoja took a large force in an attempt to capture Yarkand. At Yarkand, Chinese merchants and the Qing military declined to battle openly, taking cover inside fortifications and killing Khoqandi troops from a distance with guns and cannons. Yarkand's Turkic Muslims also helped the Qing defend against the invaders.

Over the next three months, neither the Khoqandian army nor Yusuf Khoja and his partisans were able to make any further conquests. No support of any kind was received from the populace and no major rebellion supported the expedition. Eventually a Qing relief force of 40,000 arrived. By the end of December 1830, the Khoqandian army and Yusuf Khoja had retreated back to Khoqand.

Rather than punish Khoqand for the invasion of 1830, the Qing realized that their former approach of trade sanctions and restrictions was ineffective at stabilizing the territory and preventing conflict. As a result, the Qing entered into an agreement with Khoqand in 1832 that normalized the relationship between the two countries first by pardoning the Kashgharians living in exile in Khoqand and the Kashgharians living in Altishahr who had supported the holy war. The Qing then compensated Khoqandi merchants for their merchandise and property losses. With regard to commerce, the Qing removed the trade sanctions that they had put in place and began treating Khoqand as a favored trading partner with special privileges related to taxes, duties and tariffs.

Jāhangīr Khoja's dynasty (1847)
In August 1847, the sons and grandsons of Jāhangīr Khoja and his two brothers including Katta Tore, Yusuf Khoja, Wālī Khān, Tawakkul Tore, and Kichik Khan took advantage of the weakness of the Qing garrisons in Altishahr and crossed the border with a large force to attack Kashghar. The city of Kashghar was taken in less than a month after which the Qing fortresses in Kashghar and Yangihissar were besieged. The Qing fortresses held strong, however, and the excesses of the Āfāqī Khoja invaders alienated the citizens to such an extent that no support was received from the local Muslim community and no popular uprising occurred as it had in previous raids. To the citizens of the cities attacked, the invaders seemed like Khoqandi agents rather than spiritual liberators. In November, the Chinese were able to assemble a relief force and ultimately defeat the khojas in battle at Kok Robat near Yarkand. After the battle, the khojas collapsed and fled back to Khoqand.

Wālī Khān (1857)
Wālī Khān was successful in capturing Kashghar in 1857 and holding the throne as Amir for approximately three months. In capturing the city, Wālī Khān had the support of the local population at the outset but lost favor for his harsh, tyrannical leadership and the imposition and strict enforcement of dress codes, religious customs and traditions. During his short reign, Wālī Khān also gained notoriety when he infamously killed the German explorer Adolf Schlagintweit for no apparent reason. Ultimately, Wālī Khān was abandoned by his supporters because of his cruelty and defeated by a Qing army.

Impact
Compared with the invasions undertaken in 1826 and 1830, the raids of the 1850s lacked any formal state support on the part of Khoqand. In each case, the raids were carried out in an independent manner. After the raid of Husayn Īshān Khwāja and Wālī Khān in 1855, the Qing court formally investigated the invasion and concluded that the raid was not sponsored by Khoqand. As further proof of non-complicity on the part of Khoqand, the ruler of Khoqand, Khudàyàr Khàn, attempted to execute Wālī Khān in 1855 for massacring Muslims during the raid and ordered that surveillance be placed in the future on khoja leaders.

Dungan revolt
As the decade of the 1860s opened, the Qing economy and military continued 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 Shaanxi. The fighting grew and became known over time as the Dungan Revolt. As the Qing brought the Taiping army to Shaanxi 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 Shaanxi and Gansu 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 Shaanxi province forcing the Dungan militias west into Gansu.

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 recapture of Altishahr and occupied Kashghar.

Legacy
Today what was known to Central Asians as Altishahr is now a part of the Xinjiang Uygur Autonomous Region of the People's Republic of China. With the creation and administration of the Chinese provincial system there has been extensive immigration of Han Chinese and sinicization of Xinjiang has taken place. Although the Turkic people still maintain a plurality in Xinjiang the population of Han Chinese is very likely to surpass all other ethnicities in the near future.