Meanwhile the people of Soghd rose against their chief, and set up another named Ghūzek in his stead. The deposed Tarkhūn put an end to his own life.
In A.H. 93 (711) Chighān, king of Khwārazm, secretly invited Kutayba to help him against his brother Khorzād, who, though younger than himself, usurped much of his power and appropriated a large share of his possessions. Kutayba, satisfied with the terms offered, arrived unexpectedly at Hazārasp,[132] whereupon Khorzād gave himself up, and was handed over as a prisoner to his brother Chighān. After recompensing Kutayba handsomely, he begged him as a further favour to assist him in crushing the king of Khāmjerd, who had repeatedly invaded his territory. Kutayba intrusted the operation to his brother, who slew the king, conquered his realm, and brought 4000 slaves to Merv.
Having thus brought his Khwārazmian campaign to a successful termination, Kutayba turned his attention to Soghdiana, which, as related above, had been the theatre of a revolution. He reached Samarkand without adventure, and at once invaded the historic city. The resistance of the Soghdians was most stubborn; they made frequent sorties,[133] and defied the besiegers to do their worst. The new king, however, alarmed at the persistence of the Arabs, sent a letter to the king of Shāsh asking his aid. Two thousand men of Shāsh set out at once for Samarkand; but Kutayba, hearing of their movements, surprised them in ambuscade and put them to rout. Two days later the king sued for peace. Kutayba agreed to retire on payment of a heavy tribute, but stipulated that he should be allowed to enter the city and build a mosque and inaugurate a religious service. His terms were accepted, but instead of masons he sent 4000 armed Arabs to uproot idolatry. All the graven images of Samarkand were burned, Kutayba himself commencing the conflagration and inaugurating the _auto-da-fé_.
The hostility of Shāsh was not forgotten. At the beginning of A.H. 94 (712) Kutayba set out from Merv, crossed the Oxus, and marched against Shāsh and Farghāna at the head of a large army.[134] The expedition resulted in the reduction of the towns of Shāsh, Khojand, and Kāshān on terms similar to those accorded to the people of Samarkand.[135]