Agra has a rich historical background, which is amply evident from the numerous historical monuments in and around the city. The earliest reference for Agra comes from the epical age, when Mahabharata refer Agra as Agravana. In the sources prior to this, Agra has been referred as Arya Griha or the abode of the Aryans. The first person who referred Agra by its modern name was Ptolemy.
Though the heritage of Agra city is linked with the Mughal dynasty, numerous other rulers also contributed to the rich past of this city. Modern Agra was founded by Sikandar Lodhi (Lodhi dynasty; Delhi Sultanate) in the 16th century. Babar (founder of the Mughal dynasty) also stayed for sometime in Agra and introduced the concept of square Persian-styled gardens here. Emperor Akbar built the Agra fort and Fatehpur Sikri near Agra. Fatehpur Sikri remained his capital for around fifteen years after which the city was left isolated in mysterious circumstances. Jahangir beautified Agra with palaces and gardens despite spending most of his time in Kashmir with which he was passionately attached.
Agra came to its own when Shahjahan ascended to the throne of Mughal Empire. He marked the zenith of Mughal architecture, when he built the Taj in memory of his beloved wife Mumtaz Mahal. In his later years, Shahjahan shifted his capital to the new city of Shahjahanabad in Delhi and ruled from there. Shahjahan was dethroned in 1658 by his son, Aurangzeb who imprisoned him in the Agra Fort. Aurangzeb shifted the capital back to Agra till his death. After the death of Aurangzeb, Mughal Empire could not touch its peak and many regional kingdoms emerged. The post-Mughal era of Agra saw the rule of the Jats, Marathas and finally the British taking over the city.