He was first elected MLA from Karchana in 2004 on a Samajwadi Party ticket, after his father vacated the seat on entering the Lok Sabha, and was later re-elected. As environment minister in the Mulayam Singh Yadav government he was associated with the launch of CNG in Agra, Lucknow and Kanpur, and he also chaired the state Beej Vikas Nigam.
On 2 April 2024 he joined the Congress, which fielded him from Allahabad as the INDIA bloc candidate.
He polled 4,62,145 votes and defeated BJP's Neeraj Tripathi by 58,795 votes. In the Lok Sabha he has demanded an AIIMS for Prayagraj and spoken on electoral reforms and in the debate on 150 years of Vande Mataram.