Agra is a city on the banks of the river Yamuna in the northern state of Uttar Pradesh, India. It is 378 kilometres (235 mi) west of the state capital, Lucknow, 206 kilometres (128 mi) south of the national capital New Delhi and 125 kilometres (78 mi) north of Gwalior. Agra is one of the most populous cities in Uttar Pradesh, and the 24th most populous in India.
Agra is a major tourist destination because of its many Mughal-era buildings, most notably the Tāj Mahal, Agra Fort and Fatehpūr Sikrī, all three of which are UNESCO World Heritage Sites. Agra is included on the Golden Triangle tourist circuit, along with Delhi and Jaipur; and the Uttar Pradesh Heritage Arc, tourist circuit of UP state, along Lucknow the capital of the state and Varanasi. Agra falls within the Braj cultural region.
The city was first mentioned in the epic Mahābhārata, where it was called Agrevaṇa (derived from Sanskrit (अग्रेवण) meaning "the border of the forest"). Legend ascribes the founding of the city to Agre Jat clan, Agra is named after Agre or Agr Jat.
However, the 11th century Persian poet Mas'ūd Sa'd Salmān writes of a desperate assault on the fortress of Agra, then held by the Shāhī King Jayapala, by Sultan Mahmud of Ghazni. It was mentioned for the first time in 1080 AD when a Ghaznavide force captured it. Sultan Sikandar Lodī (1488–1517) was the first to move his capital from Delhi to Agra in 1506. He governed the country from here and Agra assumed the importance of the second capital. He died in 1517 and his son, Ibrāhīm Lodī, remained in power there for nine more years and several palaces, wells and a mosque were built by him in the fort during his period. Finally being defeated at the Battle of Panipat in 1526. Between 1540 and 1556, Afghans, beginning with Sher Shah Suri ruled the area. It was the capital of the Mughal Empire from 1556 to 1658.