11th-century book Tarikh Yamini, written by al-Utbi, stated that when the Ghaznavid Emir Sabuktigin defeated the Hindu Shahi ruler Jayapala in 988, the Pashtuns (Afghans) and Khalaj between Laghman and Peshawar, the territory he conquered, surrendered and agreed to serve him. Al-Utbi further stated that Pashtun and Khalaj tribesmen were recruited in significant numbers by the Ghaznavid Sultan Mahmud of Ghazni (999-1030) to take part in his military conquests, including his expedition to Tokharistan. The Khalaj later revolted against Mahmud's son Sultan Mas'ud I of Ghazni (1030-1040), who sent a punitive expedition to obtain their submission. During the time of the Mongol invasion of Khwarezmia, many Khalaj and Turkmens gathered in Peshawar and joined the army of Saif al-Din Ighraq, who was likely a Khalaj himself. This army defeated the petty king of Ghazni, Radhi al-Mulk. The last Khwarazmian ruler, Jalal ad-Din Mingburnu, was forced by the Mongols to flee towards the Hindu Kush. Ighraq's army, as well as many other Khalaj and other tribesmen, joined the Khwarazmian force of Jalal ad-Din and inflicted a crushing defeat on the Mongols at the 1221 Battle of Parwan. However, after the victory, the Khalaj, Turkmens, and Ghoris in the army quarreled with the Khwarazmians over the booty, and finally left, soon after which Jalal ad-Din was defeated by Genghis Khan at the Battle of the Indus and forced to flee to India. Ighraq returned to Peshawar, but later Mongol detachments defeated the 20,000-30,000 strong Khalaj, Turkmen, and Ghori tribesmen who had abandoned Jalal ad-Din. Some of these tribesmen escaped to Multan and were recruited into the army of the Delhi Sultanate. 13th-century Tarikh-i Jahangushay, written by historian Ata-Malik Juvayni, narrated that a levy comprising the Khalaj of Ghazni and the Afghan (Pashtuns) were mobilized by the Mongols to take part in a punitive expedition sent to Merv in present-day Turkmenistan.