The Rashidun, Umayyad, and Abbasid Caliphates
Arab Muslims first attacked the Sassanid territory in 633, when general Khalid ibn Walid invaded Mesopotamia , which was the political and economic center of the Sassanid state. Following the transfer of Khalid to the Byzantine front in the Levant, the Muslims eventually lost their holdings to Sassanian counterattacks. The second invasion began in 636 under Saad ibn Abi Waqqas, when a key victory at the Battle of Qadisiyyah led to the permanent end of Sasanian control west of Iran. The Zagros mountains then became a natural barrier and border between the Rashidun Caliphate and the Sassanid Empire. Owing to continuous raids by Persians into the area, Caliph Umar ordered a full invasion of the Sasanian empire in 642, which was completed with the complete conquest of the Sasanians around 651. The quick conquest of Iran in a series of well coordinated multi-pronged attacks, directed by Caliph Umar from Medina several thousand miles from the battlefields in Iran, became his greatest triumph, contributing to his reputation as a great military and political strategist. Iranian historians have sought to defend their forebears by using Arab sources to illustrate that "contrary to the claims of some historians, Iranians, in fact, fought long and hard against the invading Arabs." By 651, most of the urban centers in Iranian lands, with the notable exception of the Caspian provinces (Tabaristan) and Transoxiana, had come under the domination of the Arab armies. Many localities in Iran staged a defense against the invaders, but in the end none was able to repulse the invasion. Even after the Arabs had subdued the country, many cities rose in rebellion, killing the Arab governor or attacking their garrisons, but reinforcements from the caliphs succeeded in putting down all these rebellions and imposing the rule of Islam. The violent subjugation of Bukhara after many uprisings is a case in point. Conversion to Islam was, however, only gradual. In the process, many acts of violence took place, Zoroastrian scriptures were burnt and many priests executed. Once conquered politically, the Persians began to reassert themselves by maintaining Persian language and culture. Regardless, Islam was adopted by many, for political, socio-cultural or spiritual reasons, or simply by persuasion, and became the dominant religion.
The Saffarid Dynasty
The Saffirid Dynasty was a Muslim Persianate dynasty from Sistan that ruled over parts of eastern Iran, with its capital at Zaranj (a city now in southwestern Afghanistan). Khorasan, Afghanistan and Balochistan from 861 to 1003. The dynasty, of Persian origin, was founded by Ya'qub bin Laith as-Saffar, born in 840 in a small town called Karnin (Qarnin), which was located east of Zaranj and west of Bost, in what is now Afghanistan - a native of Sistan and a local ayyar, who worked as a coppersmith before becoming a warlord. He seized control of the Sistan region and began conquering most of Iran and Afghanistan, as well as parts of Pakistan, Tajikestan and Uzbekistan. The Saffarids used their capital Zaranj as a base for an aggressive expansion eastward and westward. They first invaded the areas south of the Hindu Kush in Afghanistan and then overthrew the Persian Tahirid dynasty, annexing Khorasan in 873. By the time of Ya'qub's death, he had conquered the Kabul Valley, Sindh, Tocharistan, Makran (Balochistan), Kerman, Fars, Khorasan, and nearly reached Baghdad but then suffered a defeat by the Abbasids. The Saffarid empire did not last long after Ya'qub's death. His brother and successor, Amr bin Laith, was defeated at the Battle of Balkh against Ismail Samani in 900. Amr bin Laith was forced to surrender most of his territories to the new rulers. The Saffarids were subsequently confined to their heartland of Sistan, with their role reduced to that of vassals of the Samanids and their successors.
The Samanid and Ghaznavid Dynasties
The Samanid Dynasty was a Sunni Persian Empire in Khorasan and Transoxiana. The Samanids ruled as Amirs of Khorasan, nominally appointed by the Abbasid Caliph in Baghdad. They claimed descent from the House of Mihran, high nobility of the Sasanian and Parthian empires conquered by the Arabs, and were characteristic of the shift of the Abbasid administration towards reliance on a class of Persian mawali and Turkish mamluks rather than the Umayyad Arab aristocracy held together by familial ties. Samanid rule is part of the so-called Iranian Intermezzo, which saw the creation of a Persianate Muslim culture and identity that brought Iranian speech and traditions into the fold of the Islamic world. This would lead to the formation of the Turko-Persian high culture that would characterise Greater Iran for a thousand years.
The Ghaznavid Dynasty was a Persianate Muslim dynasty of Turkic mamluk origin at their greatest extent ruling large parts of Iran, much of Transoxiana, and North India from 977-1186. The dynasty was founded by Sabuktigin, upon his succession to rule of Ghazna after the death of his father-in-law, Alp Tigin, who was a breakaway ex-general of the Samanid Empire from Balkh, north of the Hindu Kush in Greater Khorasan. Although the dynasty was of Central Asian Turkic origin, it was thoroughly Persianized in terms of language, culture, literature, and habits, and hence is regarded by some as a "Persian dynasty" rather than Turkic. Sabuktigin's son, Mahmud of Ghazni, declared independence from the Samanid Empire and expanded the Ghaznavid Empire to the Amu Darya, the Indus River and the Indian Ocean in the East, and to Rey and Hamadan in the west. Under the reign of Mas'ud I, the Ghaznavid dynasty began losing control over its western territories to the Seljuq dynasty after the Battle of Dandanaqan, resulting in a restriction of its holdings to modern-day Afghanistan, Punjab, Pakistan, and Balochistan. In 1151, Sultan Bahram Shah lost Ghazni to the Ghurid king Ala al-Din Husayn.