Throughout India's history the region of Delhi, commanding roads in all directions, was the key to empire. From the earliest times many cities rose and fell there, and within 50 sq mi (130 sq km) S of New Delhi are more important dynastic remains than exist in any other area of the country. The earliest city on the Delhi plain was the semilegendary Indraprastha, mentioned in the Hindu epic Mahabharata. Another historic site is the Rajput citadel and town containing the Lal Kot [red fort], erected in 1052; it is sometimes confused with Shah Jahan's Red Fort in Old Delhi.
In 1192 the legions of the Afghan warrior Muhammad of Ghor captured the Rajput town, and the Delhi Sultanate was established (1206). The invasion of Delhi by Timur in 1398 put an end to the sultanate; the Lodis, last of the Delhi sultans, gave way to Babur, who, after the battle of Panipat in 1526, founded the Mughal empire. The early Mughal emperors favored Agra as their capital, and Delhi became their permanent seat only after Shah Jahan built (1638) the walls of Old Delhi. Among the most famous monuments on the Delhi plain are the 12th-century Kutb Minar and the tomb of Humayan (built 1565–69; it is the architectural prototype of the Taj Mahal at Agra).