quality:correction, information:filtering
Medieval history

Islamic conquest

Until the 9th century, Kandahar and other regions ruled by the Zunbils were considered part of the Indian Subcontinent, though it was an Eastern Iranic realm which followed Zurvanism. In the 7th century AD, Arab armies conquered the region but failed to convert the entire population to Islam.The leader of the expedition was Abbad ibn Ziyad, who governed Sijistan between 673 and 681. In AD 870, Yaqub ibn Layth Saffari, a local ruler of the Saffarid dynasty, conquered Kandahar and environs in the name of Islam.

Ghanavids

It is believed that the Zunbil dynasty were the rulers of the Kandahar region from the 7th century until the late 9th century AD. Kandahar was taken by Sultan Mahmud of Ghazni in the 11th century followed by the Ghurids of Ghor.

Kandahar appears to have been renamed Teginābād in the 10th-12th centuries, but the origin of the new name is unclear. During this period, nearby Panjway served as the administrative center for the area. However, Kandahar was of much more strategic importance, to the extent that Minhaj-i-Siraj attributes the downfall of the Ghaznavids to the loss of Kandahar. The city's name was changed back to Kandahar by the 13th century, after Ala ad-Din Husayn Jahansuz sacked Lashkari Bazar, near Bost. Again, the reason for the name change is not clear.

Mongols

Kandahar was besieged by a Mongol army in 1221, although Jalal ad-Din Mingburnu defeated them. In 1251, upon accession to the Mongol throne, Möngke Khan granted Kandahar, along with other lands in Afghanistan, to Shams ad-Din Mohammad Kart of the Kart dynasty. However, the city is mentioned as being under Chagatai control in 1260–61; Kandahar didn't come under Kart control until 1281. Later, in 1318, a Chagatai prince raised an army from Kandahar against the Ilkhanid governor of Sistan. Kandahar was described by Ibn Battuta in 1333 as a large and prosperous town three nights journey from Ghazni.

Timur the Great, founder of the Timurid Empire, captured Kandahar in 1383. He appointed his grandson Pir Muhammad as governor of Kandahar in 1390. Following his death in 1405, the city was ruled by other Timurid governors. Kandahar was entrusted to the Arghuns in the late 15th century, who eventually achieved independence from the Timurids. Guru Nanak, the founder of Sikhism, is believed to have visited the town (c. 1521 AD) during his important journey between Hindustan and Mecca in Arabia.

Mughal and Safavid Era

Tamerlane's descendant, Babur, the founder of the Mughal Empire, annexed Kandahar in 1508. In 1554, Babur's son, Humayun, handed it over to the Safavid Shah Tahmasp in return of 12,000 soldiers he received from the Shah to reconquer India. In 1595, Humayun 's son Akbar the Great reconquered the city by diplomacy. Akbar died in 1605 and when this news reached the Persian court, Shah Abbas ordered his army to besiege the city which continued until early 1606 and finally failed due to the reinforcements sent by the Mughal Emperor Jahangir that forced the Safavid retreat. In the Mughal–Safavid War, Kandahar was once again lost to the Safavids. In 1698, Mughals under Samandar Khan of Kalat State captured Kandahar again. Kandahar was regarded as important to the Mughal Empire because it was one of the gateways to India, and Mughal control over Kandahar helped to prevent foreign intrusions.

The memory of the wars fought over Kandahar at this time is preserved in the epic poem Qandahār-nāma ("The Campaign Against Qandahār"), a major work of Saib Tabrizi which is a classic of Persian literature.