In a huge blow to the ruling BJP, the Samajwadi Party on Wednesday took what it said were winning leads in both the Lok Sabha seats of Gorakhpur and Phulpur that were vacated by Chief Minister Yogi Adityanath and his deputy Keshav Prasad Maurya.

With the Bahujan Samaj Party (BSP) backing its bitter rival Samajwadi Party, the Bharatiya Janata Party appeared to be heading for a shock defeat in both the constituencies.

The Samajwadi Party took early lead right from the beginning of the vote count and steadily built up the gap with its BJP rivals as officials furiously counted the tens of thousands of votes polled in the Sunday by-elections.

After the 10th round of counting in Phulpur, BJP's Kashlendra Singh Patel had secured 106,534 votes and the Samajwadi Party's Nagendra Singh Patel 122,247 -- a lead of 15,713 votes.

In Gorakhpur, which Adityanath represented for five straight terms since 1998, BJP candidate Upendra Dutt Shukla was trailing to the Samajwadi Party by 7,139 votes, an Election Commission official told IANS.

Gorakhpur District Magistrate Rajeev Rautela, who earlier sparked a storm by barring journalists from entering the counting centre and did not announce details of counting after the first two rounds, said Pravin Nishad of the Samajwadi Party was leading by 10,598 votes after eight rounds of vote count.

While the Samajwadi Party activists started celebrating what now looks like a sure and morale-boosting victory, the BJP was stunned into silence.