It is generally accepted that Agra was both an ancient city from the times of the Mahabharata (see above) and yet nevertheless Sultan Sikandar Lodī, the Muslim ruler of the Delhi Sultanate, founded Agra in the year 1504. After the Sultan’s death, the city passed on to his son, Sultan Ibrāhīm Lodī. He ruled his Sultanate from Agra until he fell fighting to Mughal Badshah (emperor) Bābar in the First battle of Panipat fought in 1526.
The golden age of the city began with the Mughals. It was known then as Akbarabād and remained the capital of the Mughal Empire under the Badshahs (emperors) Akbar, Jahāngīr and Shāh Jahān. Akbar made it the eponymous seat of one of his original twelve subahs (imperial top-level provinces), bordering (Old) Delhi, Awadh (Oudh), Allahabad, Malwa and Ajmer subahs. Shāh Jahān later shifted his capital to Shāhjahānabād in the year 1649.
Since Akbarabād was one of the most important cities in India under the Mughals, it witnessed a lot of building activity. Babar, the founder of the Mughal dynasty, laid out the first formal Persian garden on the banks of river Yamuna. The garden is called the Arām Bāgh or the Garden of Relaxation. His grandson Akbar the Great raised the towering ramparts of the Great Red Fort, besides making Agra a centre for learning, arts, commerce and religion. Akbar also built a new city on the outskirts of Akbarabād called Fatehpūr Sikrī. This city was built in the form of a Mughal military camp in stone.
His son Jahāngīr had a love of flora and fauna and laid many gardens inside the Red Fort or Lāl Qil’a. Shāh Jahān, known for his keen interest in architecture, gave Akbarabād its most prized monument, the Tāj Mahal. Built in loving memory of his wife Mumtāz Mahal, the mausoleum was completed in 1653.
Shāh Jahān later shifted the capital to Delhi during his reign, but his son Aurangzeb moved the capital back to Akbarabād, usurping his father and imprisoning him in the Fort there. Akbarabād remained the capital of India during the rule of Aurangzeb until he shifted it to Aurangabad in the Deccan in 1653.
After the decline of the Mughal Empire, the city came under the influence of Marathas and was called Agra, before falling into the hands of the British Raj in 1803.
In 1835 when the Presidency of Agra was established by the British, the city became the seat of government, and just two years later it was witness to the Agra famine of 1837–38. During the Indian rebellion of 1857 British rule across India was threatened, news of the rebellion had reached Agra on 11 May and on 30 May two companies of native infantry, the 44th and 67th regiments, rebelled and marched to Delhi. The next morning native Indian troops in Agra were forced to disarm, on 15 June Gwalior (which lies south of Agra) rebelled. By 3 July, the British were forced to withdraw into the fort. Two days later a small British force at Sucheta were defeated and forced to withdraw, this led to a mob sacking the city. However, the rebels moved onto Delhi which allowed the British to restore order by 8 July. Delhi fell to the British in September, the following month rebels who had fled Delhi along with rebels from Central India marched on Agra but were defeated. After this British rule was again secured over the city until the independence of India in 1947.
Agra is the birthplace of the religion known as Dīn-i Ilāhī, which flourished during the reign of Akbar and also of the Radhaswami Faith, which has around two million followers worldwide. Agra has historic linkages with Shauripur of Jainism and Runukta of Hinduism, of 1000 BC.