After more than eight months in limbo, Spain got its new government at last on Tuesday after an MPs' vote.
The leader of the PSOE Socialist party, Pedro Sánchez, won the support of the Congreso in the investiture debate and vote that saw MPs cut short their New Year break and start debating last Saturday. By Wednesday Sánchez had been sworn in by King Felipe as prime minister.
The vote was as close as it could have been. 167 voted in favour of Sánchez's candidacy, 165 against and there were 18 abstentions.
The 120 PSOE MPs were added to the 35 votes of left-wing Unidas Podemos (UP), guaranteed after the post-general-election pact between Sánchez and UP leader Pablo Iglesias. The two parties now embark on the first coalition government in modern times.
Others adding to the 167 tally of supporting MPs were centre-right Basque nationalists, PNV; left-wing Más País and Compromis; and three MPs from regional parties.
Key to getting through the vote was the abstention of Catalan left-wing nationalists, ERC, announced last week in return for round-table meetings being set up on the political future of Catalonia between Madrid and Barcelona. Left-wing Basques, EH Bildu, also abstained.
There was anger at the PSOE deal with ERC. The Cantabrian regional party changed its single vote as a result and the one MP of regional Coalition Canarias went against her party and swapped her vote too.
Having failed to win an overall majority of MPs' support in a first vote on Sunday, as was expected, the Tuesday simple 'yes or no' vote was nail-biting, with opposition parties trying to persuade any rogue PSOE MPs to change their mind.
The debate had been particularly fiery. The Ciudadanos spokesperson in Congreso, Inés Arrimadas, said that Sánchez "treated independence supporters better than those in favour of the constitution". "We are not on the eve of the apocalypse," retorted Sánchez.
Conservative PP leader, Pablo Casado, called the PSOE leader "a sociopath, irresponsible, a liar, a fake PM, pathetic, arrogant and lacking dignity". Hard-right Vox leader, Santiago Abascal, went further adding, "Conman, liar, unscrupulous, comic book villain, unworthy politician and charlatan." Sánchez in reply accused Vox of "lying more than talking". One newcomer MP said he was "scandalised by the tone of the language".
New partner in government, UP's Pablo Iglesias, was softer, saying it was an honour to join the new PM on the journey.
Local MP to become a minister
Complete details of the coalition government won't probably be announced until next week, although UP has been promised one of four deputy PM positions, for Pablo Iglesias, and four ministries, all with a social policy leaning. The PSOE were reportedly upset with UP this week for leaking details of who would be UP's ministers.
A local Malaga province MP, Alberto Garzón, who is leader of Izquierda Unida, part of the UP alliance, will take up the new minister of Consumer Affairs role.
At his very brief swearing-in ceremony, the King joked with Pedro Sánchez, "The pain comes later".
After failing to gain an overall majority in the investiture debate over the weekend, Sánchez - until now acting PM - scraped a simple majority on Tuesday, gaining 167 votes in favour and 165 against.
It was the controversial abstention by MPs from Catalan and Basque pro-independence groups ERC and EH Bildu that swung the balance in Sánchez's favour.
Following a deal struck with leftist Unidas Podemos leader Pablo Iglesias after the general election in November, Sánchez will lead the country's first coalition government since 1939.