Samajwadi Party was founded in October 1992 by four-time Uttar Pradesh chief minister Mulayam Singh Yadav after the Janata Dal broke into several regional parties. His son Akhilesh Yadav succeeded him to the top party post on 1 January 2017.
However, the succession of the power wasn't a cakewalk for Akhilesh. Over the five year tenure of Akhilesh as the UP CM since 2012, the Yadav family was divided into two feuding groups. Of the two groups, one was in support of Akhilesh and the other was spearheaded by Mulayam's cousin Shivpal Yadav who had felt that he had been surpassed to make Akhilesh the CM. Akhilesh and Shivpal on several occasions voiced views differing from each other.
The family feud reached the pinnacle when Mulayam on 30 December 2016 exercised his power as the party chief and expelled his son Akhilesh and his cousin Ram Gopal who had been backing his son, citing indiscipline as the reason. He later revoked the decision within 24 hours. However, in response to the action taken against him, Akhilesh removed his father as the president of the party at a national convention of the party held on 1 January 2017. Mulayam knocked the doors of the Election Commission appealing that the national convention be termed illegal and expelled Ram Gopal for convening the national executive convention. Ruling in favour of Ram Gopal, the ECI said that he had the right to convene the party convention and reversed Mulayam's order paving way for Akhilesh to become the new party chief.
For the 2019 Lok Sabha election, Akhilesh has joined hands with the Bahujan Samaj Party, a feat which many thought was unthinkable. Mayawati had vehemently refused to ally with Mulayam led Samajwadi Party owing to an incident which dates back to 1995, infamously referred to as the guest house scandal. Back then when BSP broke ties with the SP leading to the fall of the government, SP members had reportedly attacked the guest house in which BSP leaders along with Mayawati were staying. Mayawati was reportedly harassed, her room was vandalised, and casteist and sexist slurs were thrown at her. Since then, Mayawati had refused to tie up with the SP in any capacity.
However, with Akhilesh at the helm, SP-BSP tied up and defeated the BJP in Gorakhpur and Phulpur bypolls. Owing to the success in the bypolls, the two leaders joined hands for the 2019 Lok Sabha election, agreeing at a deal of 37 seats for the SP and 38 seats for the BSP of the 80 parliamentary seats.