quality:corruption, information:highlighting, information:extraction
Medieval period

Arab Muslims brought Islam to Herat and Zaranj in 642 CE and began spreading eastward; some of the native inhabitants they encountered accepted it while others revolted. Before the arrival of Islam, the region used to be home to various beliefs and cults, often resulting in Syncretism between the dominant religions such as Zoroastrianism, Buddhism or Greco-Buddhism, Ancient Iranian religions, Hinduism, Christianity, and Judaism. An exemplification of the syncretism in the region would be that people were patrons of Buddhism but still worshipped local Iranian gods such as Ahura Mazda, Lady Nana, Anahita or Mihr (Mithra) and portrayed Greek gods as protectors of Buddha. The Zunbils and Kabul Shahi were first conquered in 870 CE by the Saffarid Muslims of Zaranj. Later, the Samanids extended their Islamic influence south of the Hindu Kush. The Ghaznavids rose to power in the 10th century.

By the 11th century, Mahmud of Ghazni had defeated the remaining Hindu rulers and effectively Islamized the wider region, with the exception of Kafiristan. Mahmud made Ghazni into an important city and patronized intellectuals such as the historian Al-Biruni and the poet Ferdowsi. The Ghaznavid dynasty was overthrown by the Ghurids in 1186, whose architectural achievements included the remote Minaret of Jam. The Ghurids controlled Afghanistan for less than a century before being conquered by the Khwarazmian dynasty in 1215.

In 1219 CE, Genghis Khan and his Mongol army overran the region. His troops are said to have annihilated the Khwarazmian cities of Herat and Balkh as well as Bamyan. The destruction caused by the Mongols forced many locals to return to an agrarian rural society. Mongol rule continued with the Ilkhanate in the northwest while the Khalji dynasty administered the Afghan tribal areas south of the Hindu Kush until the invasion of Timur (aka Tamerlane), who established the Timurid Empire in 1370. Under the rule of Shah Rukh, the city of Herat served as the focal point of the Timurid Renaissance, whose glory matched Florence of the Italian Renaissance as the center of a cultural rebirth.

In the early 16th century Babur arrived from Ferghana and captured Kabul from the Arghun dynasty. Babur would go on to conquer the Afghan Lodi dynasty who had ruled the Delhi Sultanate in the First Battle of Panipat. Between the 16th and 18th century, the Uzbek Khanate of Bukhara, Iranian Safavids, and Indian Mughals ruled parts of the territory. During the medieval period, the northwestern area of Afghanistan was referred to by the regional name Khorasan, which was commonly used up to the 19th century among natives to describe their country.