New Delhi: The contours of the opposition’s grand alliance started taking shape on Wednesday, a day after the dramatic comeback by the Rahul Gandhi-led Congress party in elections to three Hindi-heartland states.

The Mayawati-led Bahujan Samaj Party (BSP) and the Akhilesh Yadav-led Samajwadi Party (SP) on Wednesday extended support to the Congress, helping its bid to form the government in Madhya Pradesh and Rajasthan with the support of the majority of legislators.

Mayawati’s hand of friendship comes two months after she snubbed the Congress to ally with Ajit Jogi in Chhattisgarh. The BSP chief had also turned down a Congress offer of pre-poll alliance in Madhya Pradesh, Rajasthan, and Chhattisgarh.

If Mayawati’s and Yadav’s offers of support lead to renewed ties with the Congress, it could have an immediate impact in Uttar Pradesh in 2019 as the state is crucial in elections to the Lok Sabha with its 80 seats.

Congress leaders feel it could also bolster the party’s attempt of stitching together an anti-Bharatiya Janata Party (BJP) alliance ahead of the general elections.

“The main aim of our party was to ensure that the BJP stays out of power but sadly we could not do it on our own... Despite our party not agreeing completely on Congress’ policies and thoughts, we have decided to extend our support to the Congress in Madhya Pradesh to form the government," Mayawati said on Wednesday morning. The BSP would also support the Congress in Rajasthan if needed, she said.

The Congress is the single-largest party in both states, but is short of the half-way mark by one and two seats in Rajasthan and Madhya Pradesh, respectively. The BSP won six seats in Rajasthan and two in Madhya Pradesh where the SP has won one seat.

“The SP supports the Congress party to form government in Madhya Pradesh," Yadav wrote on Twitter on Wednesday.

The Congress is confident of forming the government in both states and has begun discussions for selecting the chief ministers.

Yadav and Mayawati are crucial players in Uttar Pradesh. The SP and the BSP have an electoral understanding and have contested bypolls earlier together, while the Congress has lost a lot of ground there. A grand alliance in Uttar Pradesj could bolster the opposition’s chances in the state where the BJP got the highest number of Lok Sabha seats in 2014.