housed in the Qutb complex and pillaged exquisitely carved pillars and building material from their debris for this mosque, many of which can still be seen. After the end of the Slave dynasty, a succession of Turkic Central Asian and Afghan dynasties, the Khalji dynasty, the Tughluq dynasty, the Sayyid dynasty and the Lodi dynasty held power in the late medieval period and built a sequence of forts and townships in Delhi. Timur In 1398, Timur Lang invaded India on the pretext that the Muslim sultans of Delhi were too tolerant of their Hindu subjects. After defeating the armies of Nasiruddin Mahmud of Tughlaq dynasty, on 15 December 1398, Timur entered Delhi on 18 December 1398, and the city was sacked, destroyed, and left in ruins, and over 100,000 war prisoners were killed as well. Defeat of the Lodi sultans In 1526, following the First Battle of Panipat, Zahiruddin Babur, the former ruler of Fergana, defeated the last Afghan Lodi sultan and founded the Mughal dynasty which ruled from Delhi, Agra and Lahore. Early Modern period (16th-18th centuries CE) The early modern period in Indian history is marked with the rise of the Mughal Empire between the 16th and 18th centuries. After the fall of the Delhi Sultanate, the Mughals ruled from Agra, Sikri and Lahore, but the city once became the capital in 1648 during the rule of Shah Jahan, and remained the capital until the fall of the empire. During this time, Delhi became a center for culture, and poets such as Ghalib, Dard, Dagh and Zauq lived in the city and sought patronage of the emperor. The Mughals also built several monuments in the city including Humayun's Tomb, Red Fort, and Jama Masjid. Babur and Humayun (1526–1556) The first Mughal Emperors Babur (1526-1530) and Humayun (1530-1540, restored 1556-57) ruled from Agra, unlike the preceding Delhi Sultans. In the mid-16th century there was an interruption in the Mughal rule of India as Sher Shah Suri defeated Humayun and forced him to flee to Persia. Sher Shah Suri built the sixth city of Delhi, as well as the old fort known as Purana Qila, even though this city was settled since the ancient era. After Sher Shah Suri's death in 1545, his son Islam Shah took the reins of north India from Delhi. Islam Shah ruled from Delhi. Then Humayun was briefly restored; but meanwhile in 1553 the Hindu