Muslims conquered Khorasan in the last phase of their conquest of Sasanian Persia. The conquest was followed by the Islamization of the region.
Background
In 642 the Sassanid Empire was nearly destroyed, and almost all parts of Persia were conquered, except parts of Khorasan, which were still held by the Sassanids. Khorasan was the second largest province of the Sasanian Empire. It stretched from what is now north-eastern Iran, Afghanistan and Turkmenistan. Its capital was Balkh, in present-day northern Afghanistan. In 651 after Yazdegerd III was murdered by Mahuy Suri, the marzban or administrator of Marw, Tabaristan was invaded by the Muslim Arabs.
During Rashidun and Umayyad era
Beginning of conquest
The mission of conquering Khurasan was assigned to Ahnaf ibn Qays and Abd Allah ibn Amir, as well as Abu Mansur Muhammad, commander of the cavalry. Abd Alah marched from Fars and took a short and less frequent route via Rayy. Ahnaf then marched north direct to Merv, in present Turkmenistan. Merv was the capital of Khurasan and here Yazdegerd III held his court. On hearing of the Muslim advance, Yazdegerd III left for Balkh. No resistance was offered at Merv, and the Muslims occupied the capital of Khurasan without a fight.
Second phase of conquest
Farrukhzad, the previously minister of Yazdegerd, and ruler of Tabaristan, managed to repel the Arabs with the aid of Gil Gavbara and make a treaty with them. The Arabs then invaded Khorasan, and made a treaty with the kanarang of Tus, Kanadbak. In the treaty Kanadbak agreed to surrender and assist Muslim forces while still remaining in control of his territories in Tus. Abdullah and Kanadbak then conquered Nishapur after defeating the Kanārangīyān family.
Last phase of conquest
A veteran military commander, Al-Ahnaf ibn Qays, was appointed by Umar for the conquest of Khurasan, which in those time comprises most of present-day northeastern Iran, Afghanistan and Turkmenistan. The conquest of southern Persia was completed by 23 AH with Khorasan remaining the only region remaining unconquered. Since the Muslims did not want any Persian land to remain under Persian rule, Umar ordered Ahnaf b. Qais to march upon it. After capturing the towns of Tabas and Tun, he attacked the region's easternmost city Herat. The Persians put up stiff resistance but were defeated and surrendered. A garrison was deployed in the city, while a column was detached which subjugated Nishapur and Tus. Umar had dispatched Ahnaf with 12,000 men from Kufa and Basra after Yazdegerd who had fled to Merv. After the Arabs arrived there, Yazdegerd fled to Marw al-Rudh from where he sent ambassadors to the Khakan of the Turks, the ruler of Soghd and the Chinese emperor, asking for their assistance. Yazdegerd later fled to 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 Hephthalites of Herat. Al-Ahnaf reconquered Quhistan and defeated Herat's Hephthalites at Nishapur. The kanarang or marzban of Tus asked the Arabs for assistance against the raiding Hephthalites of Herat and Badghis. He agreed to a peace agreement for 600,000 dinars.
The Hephthalite 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 and Pushang for a tribute of 1 million dirhams. The ruler who was known as azim or the "mighty one" in Futuh al-Buldan, may have been a Hephthalite chief. The Rashidun Caliphs followed the earlier rule of Muhammad of imposing jizya on several bodies jointly and in some cases also imposed the condition that they host Muslims. This rule was followed in most Iranian towns, with the jizya not specified on per capita basis, but being left to the local rulers, though some Muslim commanders stressed the amount on the ability of the ruler to pay. The same wording can be seen in Ibn Amir's treaty.
In 652, Ibn Amir sent al-Ahnaf to invade Tokharistan with 4,000 Arabs and 1,000 Iranian Muslims (evidently the Tamimis and asawira), probably because of assistance of its ruler to Yazdegerd's son Peroz. While Marw al-Rudh's garrison agreed to a peace term for the entire district under 300,000 dirhams, the town itself remained besieged. It was the last major stronghold of Sasanians and fell to al-Ahnaf after a fierce battle. After bloody fighting, its marzaban agreed to a peace treaty for 60,000 or 600,000 dirhams as well as a mutual defence pact. He was also allowed to keep his ancestral lands, for the office of marzaban to be hereditary in his family, and to be exempt from taxes along with his whole family. Baladhuri quotes Abu Ubayda as stating that the Turks were supporting the inhabitants of the town. These Turks were Hephthalites, probably from Guzgan, which may explain the reason behind the Arabs next attacking Guzgan, Faryab and Talqan.
Al-Mada'ini specifically states that Ahnaf while leading the next expedition, did not want to ask for assistance from the non-Muslims of Marw al-Rudh, probably as he did not trust them. The Arabs camped at Qasr al-Ahnaf, a day's march to the north of Marw al-Rudh. The 30,000-strong army comprising troops of Guzgan, Faryab and Talqan, supported by the Chaghanian troops, advanced to meet them. The battle was inconclusive, but the opposing side dispersed with some remaining at Guzgan while the Arabs withdrew to Marw al-Rudh. Ahnaf sent an expedition, led by al-Aqra' b. Habis and apparently consisting exclusively of Tamimis, to Guzgan. The Arabs defeated Guzgan and entered it by force. Ahnaf meanwhile advanced towards Balkh, making peace treaties with Faryab and Taloqan along the way.
Reconquest
Within a year after Yazdegerd's death, a local Iranian notable named Qarin started a revolt against the Arabs in Quhistan. He gathered his supporters from Tabasayn, Herat and Badghis, assembling a reported army of 40,000 insurgents against Arabs in Khorasan. The Arabs made a surprise attack however, killing him and many of his people while many others were taken captive. It was expected that the recently subjugated people would revolt. However, in Khorasan, no all-out effort seems to have been undertaken to the expel the Arabs after Qarin's rebellion. Chinese sources state that there was an attempt to restore Peroz by Tokharistan's army, however this episode is not confirmed by Arab sources.
In 654, the Battle of Badghis occurred between the Karen family and their Hephthalite allies against the Rashidun Caliphate led by Abd Allah ibn Amir. This battle was completed the first phase of Rashidun Conquest in the soil of Iran. Despite initial Arab setbacks and the Turgesh invasion of Khurasan, Asad ibn Abdallah al-Qasri succeeded in inflicting a defeat upon the Khagan in person in the Battle of Kharistan and turning back the Turgesh army. Despite Asad's death a few months later, this success was instrumental in preserving Muslim rule in Central Asia, as the blow to the Khagan 's prestige led to his murder soon thereafter and the collapse of Turgesh power. At the same time, Asad's conciliatory policy towards the native population laid the foundations for its eventual acceptance of Muslim rule and the Islamization of Central Asia.
In 724, immediately after the rise of Hisham ibn Abd al-Malik (r. 724–743) to the Caliphate, Asad's brother Khalid al-Qasri was appointed to the important post of governor of Iraq, with responsibility over the entire Islamic East, which he held until 738. Khalid in turn named Asad as governor of Khurasan. The two brothers thus became, according to Patricia Crone, "among the most prominent men of the Marwanid period". Asad's arrival in Khurasan found the province in peril: his predecessor, Muslim ibn Sa'id al-Kilabi, had just attempted a campaign against Ferghana and suffered a major defeat, the so-called "Day of Thirst", at the hands of the Turgesh Turks and the Soghdian principalities of Transoxiana that had risen up against Muslim rule.
From the early days of the Muslim conquests, Arab armies were divided into regiments drawn from individual tribes or tribal confederations (butun or 'asha‘ir). Despite the fact that many of these groupings were recent creations, created for reasons of military efficiency rather than any common ancestry, they soon developed a strong and distinct identity. by the beginning of the Umayyad period, this system progressed to the formation of ever-larger super-groupings, culminating in the two super-groups: the northern Arab Mudaris or Qaysis, and the south Arabs or "Yemenis" (Yaman), dominated by the Azd and Rabi'ah tribes. By the 8th century, this division had become firmly established across the Caliphate and was a source of constant internal instability, as the two groups formed in essence two rival political parties, jockeying for power and separated by a fierce hatred for each other. During Hisham ibn Abd al-Malik's reign, the Umayyad government appointed Mudaris as governors in Khurasan, except for Asad ibn Abdallah al-Qasri's tenure in 735–738. Nasr's appointment came four months after Asad's death. In the interim, the sources report variously that the province was run either by the Syrian general Ja'far ibn Hanzala al-Bahrani or by Asad's lieutenant Juday' al-Kirmani. At any rate, the sources agree that al-Kirmani stood at the time as the most prominent man in Khurasan and should have been the clear choice for governor. His Yemeni roots (he was the leader of the Azd in Khurasan), however, made him unpalatable to the Caliph.