The Agra Fort is a UNESCO World Heritage site located in Agra, Uttar Pradesh, India. It is about 2.5 km northwest of its more famous sister monument, the Taj Mahal. The fort can be more accurately described as a walled city.
The present-day structure was built by the Mughals, though a fort had stood there since at least the 11th century. Agra Fort was originally a brick fort known as Badalgarh, held by Raja Badal Singh Hindu Sikarwar Rajput king (c. 1475). It was mentioned for the first time in 1080 AD when a Ghaznavide force captured it. Sikandar Lodi (1488–1517) was the first Sultan of Delhi who shifted to Agra and lived in the fort. He governed the country from here and Agra assumed the importance of the second capital. He died in the fort in 1517 and his son, Ibrahim Lodi, held it for nine years until he was defeated and killed at Panipat in 1526. Several palaces, wells and a mosque were built by him in the fort during his period.
After the First Battle of Panipat in 1526, the victorious Babur stayed in the fort, in the palace of Ibrahim Lodi. He later built a baoli in it. The emperor Humayun was crowned in the fort in 1530. Humayun was defeated at Bilgram in 1540 by Sher Shah. The fort remained with Suris till 1555, when Humanyun recaptured it. The Hindu king Hem Chandra Vikramaditya, also called 'Hemu', defeated Humanyun's army, led by Iskandar Khan Uzbek, and won Agra. Hemu then went on to capture Delhi from the Mughals. The Mughals under Akbar defeated King Hemu finally at the Second Battle of Panipat in 1556.
Realizing the importance of its central situation, Akbar made it his capital and arrived in Agra in 1558. His historian, Abdul Fazal, recorded that this was a brick fort known as 'Badalgarh' . It was in a ruined condition and Akbar had it rebuilt with red sandstone from Barauli area in Rajasthan. Architects laid the foundation and it was built with bricks in the inner core with sandstone on external surfaces. Some 4,000 builders worked on it daily for eight years, completing it in 1573.
It was only during the reign of Akbar's grandson, Shah Jahan, that the site took on its current state. Legend has it that Shah Jahan built the beautiful Taj Mahal for his wife, Mumtaz Mahal. Unlike his grandfather, Shah Jahan tended to have buildings made from white marble. He destroyed some of the earlier buildings inside the fort to make his own.
At the end of his life, Shah Jahan was deposed and restrained by his son, Aurangzeb, in the fort. It is rumoured that Shah Jahan died in Muasamman Burj, a tower with a marble balcony with a view of the Taj Mahal. The fort was invaded and captured by the Maratha Empire in the early 18th century. Thereafter, it changed hands between the Marathas and their foes many times. After their catastrophic defeat at Third Battle of Panipat by Ahmad Shah Abdali in 1761, Marathas remained out of the region for the next decade. Finally Mahadji Shinde took the fort in 1785. It was lost by the Marathas to the British during the Second Anglo-Maratha War, in 1803.
The fort was the site of a battle during the Indian rebellion of 1857, which caused the end of the British East India Company's rule in India, and led to a century of direct rule of India by Britain.