Spain's Socialists voted on Sunday to allow the conservative Popular Party (PP) to take power, likely ending a lengthy political deadlock and avoiding a third election.
The decision paves the way for acting Prime Minister Mariano Rajoy -- whose party won two elections in December 2015 and June this year but without an absolute majority -- to form a government by November.
But while this eases uncertainty in a country that has been without a fully-functioning executive for ten months, Rajoy's government will be extremely weak, backed by just 137 lawmakers in a 350-strong parliament and with strong opposition led by the Socialists and far-left Unidos Podemos.
Both the Socialists and Unidos Podemos had categorically refused to back Rajoy, fed up with corruption scandals and rising inequalities that marked his first four-year term, paralysing his attempts to form a government.
But as the prospect of a third election grew nearer, bitter divisions emerged within the Socialists and on Sunday the party announced its policy-setting federal committee had voted 139 to 96 in favour of allowing Rajoy to rule.
They decided to abstain in a parliamentary confidence vote on the Rajoy-led government instead of casting their ballot against it as they did in a previous September vote.
This will give Rajoy's government enough traction to see it through the vote.
"Repeat elections would harm the interests of Spain and the Spanish," read the resolution that was voted through.
It added that a third poll could also hurt the Socialists themselves, who would be held responsible for "a blockage that no one wants."
First on an expanding to-do list for the new government will be updating the emergency 2017 budget to better reflect the deficit targets set by Brussels. Rajoy needs to find at least 5 billion euros in extra revenues or spending cuts.