The Friday Mosque of Herat is one of the oldest mosques in Afghanistan. (March 1962 photo)
By the 11th century, Mahmud of Ghazni defeated the remaining Hindu rulers and effectively Islamized the wider region, with the exception of Kafiristan. Afghanistan became one of the main centers in the Muslim world during this Islamic Golden Age. The Ghaznavid dynasty was overthrown by the Ghurids, who expanded and advanced the already powerful Islamic empire.
In 1219 AD, Genghis Khan and his Mongol army overran the region. His troops are said to have annihilated the Khorasanian 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 Khilji dynasty administered the Afghan tribal areas south of the Hindu Kush until the invasion of Timur, who established the Timurid Empire in 1370.
In the early 16th century, Babur arrived from Fergana and captured Kabul from the Arghun dynasty. In 1526, he invaded Delhi in India to replace the Lodi dynasty with the Mughal Empire. Between the 16th and 18th century, the Khanate of Bukhara, Safavids, and Mughals ruled parts of the territory. Before the 19th century, the northwestern area of Afghanistan was referred to by the regional name Khorasan. Two of the four capitals of Khorasan (Herat and Balkh) are now located in Afghanistan, while the regions of Kandahar, Zabulistan, Ghazni, Kabulistan, and Afghanistan formed the frontier between Khorasan and Hindustan.
(source)