For nearly one thousand years after the Pandavas, Delhi was an unimportant village until Anangpal I of the Rajput Tomars built a fort of red sandstone in 731 in what is now the Mehrauli district on the southern edge of Delhi. Lal Kot was subsequently destroyed but was rebuilt by Anangpal II around 1030, when he moved his capital from Kannauj. When Prithviraj of the Chauhan Rajputs defeated the Tomars in twelfth century, he enlarged the old city of Lal Kot, adding ramparts and a moat, and renamed the fort Qila Rai Pithora after himself.
The Qila Rai Pithora was oblong with seven gates: the Sohna, Ranjit, Ghazni, Hauz Rani, Barka, Budaun and Maya. The Sohna gate boasted a sun temple situated on a lake. At least twenty-seven Hindu and Jain temples were built inside the walls of the fortress. Anangpal II hung a bell outside of his palace for any of his subjects to ring, day or night, when his judgement was needed. He also erected an iron pillar dedicated to Vishnu in the center of the city which has not yet rusted, an example of the existing knowledge of metalworking.
In 1192, Mohammad Ghori defeated Prithviraj, the last Hindu king of Delhi. Returning to Afghanistan, he left behind his slave, Qutub-ud-din Aybak, as viceroy. Qutub-ud-din captured Delhi in 1193 and declared himself the first sultan of Delhi. The Lal Kot continued to be the capital till 1303 when Qutb-ud-din built his own citadel and India's first mosque, the Quwwat-ul-Islam Masjid, in the same area as the Red Fort later occupied. He began building his victory tower, the Qutb Minar, in 1199, completing three stories before his death. His son-in-law Iltutmish, added the fourth. The tower was damaged by lightning in 1326 and 1366, but Firoz Shah Tughlaq repaired the damage and added the fifth story to give it a completed height of 72 meters (236 feet).
i hope you get it