Your vote on this answer has already been received
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.