Spain's bitterly divided Socialist party will choose a new leader Sunday in a party primary that may determine whether or not conservative Prime Minister Mariano Rajoy's minority government will last.
The contest is widely seen as a two-way race between Susana Diaz, the president of the southern region of Andalusia, and former party leader Pedro Sanchez who was ousted in a bitter internal rebellion.
Diaz, 42, is the establishment favourite and is seen as more amenable to striking deals with the government if she wins the primary while Sanchez, 45, promises a more adversarial approach.
Rajoy's minority Popular Party (PP) government has relied on the Spanish Socialist Workers' Party (PSOE), the main opposition party, to pass key measures in parliament since it was sworn in for a second term in October 2016.
But Sanchez would have "a more fraught relationship" with the government and the risk of snap elections would increase with him in charge of the Socialists, Eurasia Group analyst Federico Santi said.
"At a minimum, therefore, a Sanchez-led PSOE would make parliamentary politics more challenging, and reduce the already limited space for economic reform," he added.
Nearly 190,000 card-carrying members of the PSOE are eligible to vote in the leadership primary with the results expected after 9 pm (1900 GMT).
Sanchez, a former economics professor, was forced to resign in October over his staunch refusal to allow Rajoy to form a minority government following two inconclusive national elections.
The architects of the messy rebellion argued it was best to let a conservative PP government through rather than go to the third elections in a year and risk losing even more votes.
Sanchez has called this a huge mistake, deeply critical of corruption scandals impacting Rajoy's PP and of their severe austerity measures.
He argues the Socialists must move further to the left to have any hope of winning back voters who have drifted to new far-left party Podemos.
He has not ruled out tabling a no confidence motion in Rajoy if he wins the leadership race.
By contrast Diaz, a plumber's daughter and career politician who was one of the leaders of the rebellion against Sanchez, talks of providing "constructive opposition" to the PP.
After an inconclusive local election in Andalusia in 2015, she made a pact with centre-right Ciudadanos -- Rajoy's allies at the national level -- to reach a parliamentary majority and form a government.
Diaz was widely tipped as the favourite but Sanchez has done better than many expected, gathering around 53,000 signatures for party members in favour of his candidacy, just 7,000 less than his rival.
A third candidate in the race, Patxi Lopez, the former president of the northern Basque Country, trailed the two by a wide margin.
Whoever wins the leadership faces a tough job ahead.
Like other Socialist parties across Europe, the PSOE has seen its support slump in recent years as voters flock to new formations like Podemos.
The party has lost the past three general elections, winning fewer seats in parliament each time.
The PSOE won just 85 of the 350 seats in parliament in last year's general election, its worst showing since Spain returned to democracy following the death of longtime dictator Francisco Franco in 1975.
While the Socialists were busy with their primary vote, Podemos staged a large protest against corruption in Madrid on Saturday, a day after it filed a motion of no confidence against Rajoy, citing graft scandals affecting his ruling PP.
The motion lacks enough support from other parties to pass but could boost its appeal to voters angry at the government who would otherwise back the Socialists.