In a major blow to the BJP, the Samajwadi Party, backed by its otherwise bitter foe BSP, wrested the Phulpur Lok Sabha seat in Uttar Pradesh.
Samajwadi Party candidate Nagendra Pratap Singh Patel defeated his nearest Bharatiya Janata Party rival Kaushlendra Singh Patel by 59,613 votes, leading to noisy celebrations and calls for opposition unity across the nation to defeat the BJP in next year's Lok Sabha battle.
The results were announced after 31 rounds of counting.
The Bahujan Samaj Party had extended support to the Samajwadi Party in a bid to avoid a split in opposition vote.
Amid beating of drums and distribution of sweets, the victorious Nagendra Patel not only thanked the people of Phulpur for his victory but said he also had the blessings of 'behenji' Mayawati along with his own leader Akhilesh Yadav.
Mafia don-turned-politician Ateeq Ahmad, contesting as an Independent from inside the jail, won 33,818 votes in Phulpur while Manish Mishra (Congress) got 11,934 votes.
Phulpur seats was vacated by Deputy Chief Minister Keshav Prasad Maurya after he was elected to the Uttar Pradesh Assembly.
UP Lok Sabha bypolls
The setback comes as a huge shocker to the year-old BJP government in Uttar Pradesh, where Adityanath has represented Gorakhpur in the Lok Sabha seat for five consecutive times.
"This is a rejection of both (Prime Minister Narendra) Modi and Yogi (Adityanath)," Samajwadi Party spokesman Anurag Bhaudauria said.
"They have been making tall promises but not delivering on the ground," he said, explaining why the voters appeared to have turned away against the BJP so dramatically in these two seats since the 2014 Lok Sabha battle.
In a rare show of camaraderie, Samajwadi Party leaders admitted that the BSP decision to back their party played a critical role in the outcome.
In 2014, the BJP stunningly won 71 of the 80 Lok Sabha seats while one of its allies secured two. The Samajwadi Party won from five seats. The Congress won two seats and the BSP drew a blank.