Balkh, where he was defeated by the Arabs and fled across Oxus River. Umar forbade Ahnaf from crossing the river as the land beyond it was unknown to Arabs and was very far for them. Yazdegerd proceeded to Soghd whose ruler supplied him with a large army. The Khaqan of Turks after assembling the troops from Ferghana, crossed the Oxus along with Yazdegerd and marched to Balkh. Ribi' b. Amir meanwhile retired with Kufan troops to Marw al-Rudh where he joined al-Ahnaf. The Sasanian king and the Khakan leading an army of 50,000 cavalry composed of men from Soghd, Turkestan, Balkh and Tokharistan, arrived at Marw al-Rudh. Ahnaf had an army of 20,000 men. The two sides fought each other from morning till evening for two months at a place called Deir al-Ahnaf. The fighting at Deir al-Ahnaf went on until Ahnaf, after being informed of a Turkic chief inspecting the outposts, went there during a particular night and successively killed three Turkic chiefs during their inspection. After learning of their deaths, the Khakan became afflicted by it and withdrew to Balkh, then he withdrew across the river to Turkestan. Yazdegerd meanwhile left from Marw al-Rudh to Merv, from where he took his empire's wealth and proceeded to Balkh to join the Khakan. He told his officials that he wanted to hand himself to the protection of the Turks, but they advised him against it and asked him to seek protection from the Arabs which he refused. He left for Turkestan while his officials took away his treasures and gave them to Ahnaf, submitting to the Arabs and being allowed to go back to their respective homes. Abdullah b. Amir went to Khorasan from Kerman in 650 and set out along with a vanguard of Tamimi Arabs and 1,000 asawira via Quhistan. The people of Tabasayn had broken their peace treaty and had allied with the Hepthalites of Herat. al-Ahnaf reconquered Quhistan and defeated Herat's Hepthalites at Nishapur. The kanarang or marzban of Tus asked the Arabs for assistance against the raiding Hepthalites of Herat and Badghis. He agreed to a peace agreement for 600,000 dinars. The Hepthalite action prompted the Muslims undertaking military operation to secure their positions in Khorasan. After the fall of Tus, Ibn Amir sent out an army against Herat. The ruler (marzaban or azim) of the place agreed to a peace treaty for Herat, Badghis