The Gulbagh of Kashgar itself alone held out, but it at last fell, after sustaining a long siege, into the hands of Jehangir. His triumph completed, he had to concern himself more with his relations with Khokand than about the Chinese, who were mysteriously quiet. Mahomed Ali Khan, of Khokand, who thought that Jehangir's success was solely due to him, laid claim to a certain historical superiority over his vassal of Kashgar, to which the Khoja prince was not willing to assent. A large Khokandian army which had been sent to Kashgar returned, after losing 1,000 men before the walls of the Gulbagh, and its withdrawal was the signal for plots and counterplots to break out in the palace of the new ruler. These he promptly repressed, reduced the intriguing general, Isa Dadkhwah, in rank, and had emancipated himself from his thraldom to Khokand, when the news came that the Chinese were at last returning.

Although the western portion of Altyshahr had fallen away from the Chinese, Aksu and Maralbashi remained true to their allegiance. The Chinese still possessed the military keys of the country. Moreover, their possession of Ili gave them an enormous strategical advantage, and in the Tungan population they possessed an almost inexhaustible supply for recruiting "revindicating" armies. It is apropos here to state that China retained both of these advantages down to the time of Buzurg Khan and Yakoob Beg, and that, so long as she possessed them, the utmost Mussulman fanaticism and Khokandian patronage of the Khojas could do was futile against the arrest of fate. During six months Jehangir ruled in Kashgar, and during six months the Chinese viceroy made his preparations at Ili for a thorough revenge. An army of more than 100,000 men, raised from the Tungani, the Calmucks, and the Khitay garrison, was despatched from Ili, and in January, 1827, entered Aksu. Here all the brigades were concentrated, and the Viceroy, in conjunction with the general under him, by name Chang-Lung, drew up the plan of campaign, which was as follows:—A small army of 12,000 men was sent against Khoten across the desert through Cày Yoli, while the remainder of the host advanced on Maralbashi. Here another detachment of 7,000 strong was directed against Yarkand, while the main body marched on Kashgar by the banks of the Kizil Su.

Their advance was unopposed until they reached Yangabad, or Yangiawat, where Jehangir had concentrated an army computed at 50,000 men, but probably considerably less. When the armies sighted each other they pitched their camps in preparation for the decisive contest that was at hand. In accordance with immemorial custom, each side put forward on the following day its champion. On the part of the Chinese a gigantic Calmuck archer opposed on the part of Jehangir an equally formidable Khokandi. The former was armed with his proper weapons, the latter with a gun of some clumsy and ancient design, and while the Khokandi was busily engaged with his intricate apparatus, the Chinese archer shot him dead with an arrow through the breast. Of course, neither army would have acquiesced in the decree of the God of Battles as shown by the fate of its champion, but, in this case, it was true that—

"Who spills the foremost foeman's life,
His party conquers in the strife."

After a sharp, but brief, skirmish, the Kashgarian army withdrew in confusion, and the following day the Chinese surrounded Kashgar on three sides. During the night the heart of Jehangir misgave him, and he fled to the Karatakka mountains. But here the snow had rendered the passes impracticable, and, after hiding for a few days in that difficult region, he was captured by the Chinese. His fate was that usually met with by traitors to that empire, for, being sent to Pekin, he was executed after torture. In this war Ishac Wang, of Ush Turfan, played a great part against the Khoja prince, and was rewarded for his good service by being appointed Wang of Kashgar. The Chinese constructed a fresh fort, Yangyshahr, in the place of the destroyed Gulbagh, and left a large Khitay garrison under Jah Darin. But Ishac Wang, who was given some such title as Prince of Kashgar, was soon afterwards deposed and recalled to China.

The Chinese authority was re-established without difficulty in the three cities, and peace settled down over Eastern Turkestan. But the repressive and punitive measures that the Chinese felt compelled to adopt raised a bitterer sentiment in the minds of the people than had previously existed. The Chinese were, indeed, only employing the same weapons that had been used against themselves, but none the less did these reciprocal atrocities dissipate whatever friendship there had been. Among other acts the Chinese removed 12,000 Mahomedan families from Kashgar to Ili, and these, destined to play an important part in the history of that province, became known as Tarantchis, or Toilers.

The Chinese resolved to punish Khokand as well. They broke off all trade with that state, and happy would it have been for them if they could have continued to preserve a closed frontier. But the Khan of that time was Mahomed Ali Khan, the most ambitious, as he was the ablest, of the princes of that country. He had just annexed Karategin, and had acquired some of the outlying provinces of Badakshan, which Mourad Beg, of Kundus, had absorbed about the same time. It was not probable that he would put up with the Chinese defiance. He was prudent enough to delay his advance until the main body of their army had been withdrawn. But, as soon as he was informed that the Chinese had gone back to Ili, Mahomed Ali, calling Yusuf, Sarimsak's eldest son, from his retirement in Bokhara, placed him at the head of an army, under the charge of his own brother-in-law, Hacc Kuli Beg. The Chinese were worsted at Mingyol, and all the cities west of Aksu turned against the Chinese, as before, and proclaimed for Yusuf Khoja. Then the massacres were repeated, and the invasion of Yusuf was that of Jehangir over again in exact detail. But Yusuf's triumph was still more brief. Whereas Jehangir had ruled for nine months, Yusuf only swayed the sceptre for three.

The Chinese movements were delayed by small Mussulman revolts in Barkul and Shensi until the spring of 1831, but then, when they returned, they found that Yusuf and the Khokandian army had retreated some months before. The facts were that the moment Khokand invaded Kashgar, Bokhara attacked Khokand, and Hacc Kuli Beg had to be recalled to cope with matters more pressing than Khoja rights. With the general had gone Yusuf, far from anxious to encounter the Chinese alone. The return of the Khokandian army sufficed to dispel all danger from Bokhara, and, a few months after, Mahomed Ali Khan recommenced operations—in the east this time—against the Kirghiz under Chinese protection. The Chinese were thoroughly sick of these petty disputes, and made a treaty with Khokand, by which that state acquired fresh commercial privileges, in addition to the old ones, and by which the importance of the Aksakals rather increased than waned. Mahomed Ali Khan had acquired all he wanted, and discouraged the Khoja party, as, indeed, the terms of this treaty compelled him to do. The risings under Jehangir and Yusuf were undoubtedly a great blow to Chinese prestige. To all appearance each had nearly been successful, and the Chinese, whose prestige was enormous in Central Asia—quite as great as that of Russia is now—had been, on one or two occasions, openly defeated. But, after all, this was a little matter compared to the shock the sentiments, called into being by sixty happy years, had received. Between Buddhist and Mussulman, between Chinaman and Central Asiatic, all the old antipathy was revived in the butcheries of Yarkand and Kashgar. The Kashgari showed that they could not appreciate the benefits they had received from China, and the Chinese, enraged at the slaughter of their countrymen, and, perhaps, also at the ingratitude evinced towards them, retaliated in kind. They did not appreciate that moderation, which Europeans have not always shown under similar circumstances, and wrought out their revenge in their own ancient fashion. It is absolutely necessary that the reader should remember that the two rapidly succeeding invasions of Jehangir and Yusuf form a turning-point in the history of the Chinese rule in Kashgar. Up to that epoch it is difficult to find words sufficient to do justice to China's beneficent government there; after that year it would be absurd to employ the same language. For the change the chief blame must fall upon the fickle and ungrateful Kashgari themselves, and then on the intriguing Andijanis. The Chinese are justified, at least, in saying that, having for more than half a century ruled this people with justice, they only relaxed in their efforts to promote its well-being when their unarmed countrymen and soldiers had been surprised and butchered by thousands.

Strange, and almost contradictory, as it may appear, there was a brief respite during which things seemed to have got into their old groove of happy prosperity; and the chief credit for this must be given to a Mahomedan sub-governor of the Chinese viceroy. Zuhuruddin, such was his name, had raised himself to the high post of Amban in Kashgar, a post never before held by any other than a Khitay. By birth he was of Kashgar, but he always represented himself as having been born and brought up in Khokand, where he had been imprisoned for a political offence. For seven or eight years he governed Kashgar to the perfect satisfaction both of the people and of the Chinese, and among some of his public acts may be mentioned the reconstruction of new forts outside the cities, in the place of those destroyed in the recent revolts. These were known now as Yangyshahr instead of Gulbagh. But in 1846 Zuhuruddin's rule was disturbed by hostilities on the part of Khokand and the Khojas.

In 1845 Khudayar Khan had been called to the throne after the death of Mahomed Ali, but his authority was not without its rivals. In the state of confusion that then ensued, Khokandian adventurers urged the Khoja princes, who were now represented by the sons of Jehangir, to renew their old attacks against the Chinese. To these advisers the Khojas turned a willing ear, and preparations were accordingly made for the enterprise. At that time Khokand was full of adventurers to whom Mahomed Ali had been able to give constant employment, but who now under the more peaceful rule of Khudayar idled their time in the cities of that khanate. Among these and the ever willing Kirghiz, it was not difficult for the princes of Kashgar to raise an army, formidable in numbers, if not remarkable for cohesion. At that time there were seven prominent Khoja princes in Khokand, of whom we may here mention Eshan Khan, usually called Katti Torah, Buzurg Khan, and Wali Khan. This inroad did not take its name from any one of these, but from them all combined; thus it was distinguished as Haft Khojagan, or that of the Seven Khojas.