Before the 2017 Assembly election he was with the All India Majlis-e-Ittehadul Muslimeen; he later joined the Samajwadi Party.
He won the Kundarki Assembly seat in Moradabad district for the SP in 2022 and resigned it on his election to the Lok Sabha.
After the death of his grandfather in February 2024, the SP fielded him from Sambhal. He polled 5,71,161 votes and defeated BJP's Parmeshwar Lal Saini by 1,21,494 votes. His oath, taken in Urdu, drew objections from some treasury members. In 2026 he has been part of SP–Congress seat-sharing discussions for the 2027 Assembly election.