Kabul before the Ghaznavids rose to power in the 10th century. By the 11th century, Mahmud of Ghazni 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. Mongols and Babur with the Lodi Dynasty 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 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. 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. However, up to the 19th century the term Khorasan was commonly used among natives to describe their country; Sir George Elphinstone wrote with amazement that the country known to outsiders as "Afghanistan" was referred to by its own inhabitants as "Khorasan" and that the first Afghan official whom he met at the border welcomed him to Khorasan. Modern history Hotak Dynasty In 1709, Mirwais Hotak, a local Ghilzai tribal leader, successfully rebeled against the Safavids. He defeated Gurgin Khan, the