stylistic:style_transfer
Later periods

The decline of the Mughal empire caused the emergence of several regional kingdoms, and in the late 18th century the control of the city fell successively to the Jats, the Marathas, the Mughals, the ruler of Gwalior, and finally the British East India Company. The Jats of Bharatpur, waged many wars against the Mughal Delhi and in the 17th and 18th century carried out numerous campaigns in Mughal territories including Agra. After the decline of the Mughal Empire, the city came under the influence of another post-Mughal Empire power, the Marathas, before falling into the hands of the British East India Company in 1803. In the years 1834–1836, Agra was the capital of the short-lived Presidency of Agra, administered by a Governor. It was then the capital of the North-Western Province from 1836 to 1858, governed by a Lieutenant-Governor. Agra was one of the centres of the Indian rebellion of 1857.

During the Indian rebellion of 1857, when East India Company rule across many parts of India was threatened, the news of the mutiny at Meerut reached Agra on 14 May. On 30 May some companies of the 44th and 67th Native Infantry sent to Mathura to bring in the treasury mutinied and carried off the treasury to the rebels in Delhi. With the fear of the rebellion spreading to Agra as well, the rest of these native infantry battalions, which were part of the garrison at Agra, were successfully disarmed by the British on 31 May. However, when the Gwalior contingent mutinied on 15 June, all other native units followed. On 2 July the rebel force of the Nimach and Nasirabad contingents reached Fatehpur Sikri. Fearing advance of the mutineers to Agra, some 6000 Europeans and associated people moved into the Agra Fort for safety on 3 July. On 5 July, the British force stationed there attempted to attack an approaching force of Mutineers, but was defeated, and the British retreated back into the fort. The Lieutenant-Governor, J.R. Colvin, died there, and was later buried in front of the Diwan-i-am. The mutineers, however, moved over to Delhi, it being a more important attraction for the rebels. Despite an uprising by a mob and extreme disorder in the city, the British managed to restore partial order by 8 July. Delhi, in turn, fell to the British in September, following which an infantry brigade led by Brigadier Edward Greathed arrived in Agra on 11 October without any opposition from rebels. But shortly after their arrival another force of mutineers attacked the brigade by surprise, but was defeated and routed. This minor victory for the British was named the Battle of Agra. It is to be said that, the uprising in Agra was relatively minor compared to Delhi, Jhansi, Meerut and other major rebellious cities and regions. After this British rule was again secured, and the British Raj ruled the city till the independence of India in 1947. The capital of the North Western Provinces was shifted from Agra to Allahabad in 1858. Gradually, Agra declined to the position of a mere provincial town, and its prosperity declined:

But in the economy of the administration of British India Agra is nothing more than a district town; its size, proportions and manifold activities have come down to its present requirements, and continued life in this city does not come above the average of that monotonous muffasil life in India which has been so often and so vividly described by many gifted Anglo-Indian writers. Agra has become of late years a large railway centre, and its commercial prosperity seems to be reviving.

Agra's role in the Indian Independence movement is not well documented. However, in the years between the mutiny and independence Agra was a major centre of Hindi and Urdu journalism. Paliwal park (formerly Hewitt park) in Agra is named after S.K.D Paliwal, who brought out the Hindi daily Sainik.