Of the five remaining seats, BSP got two and Congress one, while the rest two were bagged by independent candidates.
With this victory, SP has gained a majority in the 100-member Uttar Pradesh Legislative Council. The party had earlier faced difficulty pushing through its legislative in the upper house due to lack of numbers.
The Election Commission had issued a notification on February 8 for polling to 35 seats. Seven Samajwadi candidates were declared elected unopposed.
Of the 28 seats which went to polls on March 3, SP has won 23, including Gorakhpur, which was bagged by the party's official candidate C P Chand.
Though Chand was expelled from the party after being given ticket, he was declared elected as an official SP candidate by the EC.
A jubilant Samajwadi Party National General Secretary Ram Gopal Yadav said the results showed that people of the state have "accepted the development agenda" of the party.
BJP, however, downplayed its defeat stating that the elections were won with "money and muscle" power.
In PM Narendra Modi's Varanasi Lok Sabha constituency,
jailed mafia don Brijesh Singh, an Independent, defeated SP candidate Meena Singh, while sitting Congress MLC Dinesh Pratap Singh won in party President Sonia Gandhi's Rae Bareli constituency.
BSP got two seats -- Jaunpur and Saharanpur -- where its candidates Brijesh Singh Prinshu and Mehmood Ali won.
In SP supremo Mulayam Singh Yadav's constituency Azamgarh, Rakesh Yadav (SP) defeated Rajesh Singh of BJP while in Badaun, Banwari Singh Yadav (SP) defeated Jitendra Yadav of BJP.
In Shahjahanpur, Amit Yadav Rinku of SP defeated BJP's JPS Rathore, in Barabanki Rajesh Yadav, Hardoi Misbauddin, Mirzapur Ramlali Mishra, Gonda Mahfooz Khan, Sultanpur Shailendra Singh, Deoria Ramawadh Yadav and Faizabad Hirlal Yadav, all from Samajwadi Party were victorious.
SP candidates in Basti, Santosh Yadav Sunny, Jhansi Ram Niranjan, Bulandshahr Narendra Bhati won, while in Allahabad former Director, Education, Vasudev Yadav and in Fatehpur Dileep Singh alias Kallu, both SP, won.
Among independents who won, was Vishal Singh Chanchal, who defeated Sanand Singh of SP in Ghazipur.
