The seven-year tenure of Spain's prime minister Mariano Rajoy came to an abrupt end on Friday as he lost a parliamentary confidence vote led by Socialist Pedro Sánchez, who replaces him as the country's leader.
In the first successful no-confidence motion in modern Spanish history, 180 members of parliament voted to remove Mr Rajoy from office, with 169 voting against and one abstention.
“A new era is beginning in Spanish politics,” said Mr Sánchez, after the result was announced. “I reach out to all the parliamentary groups to open this new era. I hope we are all up to the challenge.”
Mr Sánchez had presented the motion alleging that Mr Rajoy no longer had credibility to govern due to a series of corruption scandals that have rocked his Popular Party (PP) in recent years. Last week the high court jailed several former members of the party, underlined the PP's links to a massive kickbacks network and cast doubt on Mr Rajoy's own testimony in a court appearance last year.
Spain’s constitution states that if a candidate successfully wins a no-confidence motion then he or she automatically becomes prime minister.
Mr Rajoy's fate became apparent on Thursday when the Basque Nationalist Party (PNV), which only a few days earlier had supported his 2018 budget, announced it would put its five votes behind the motion. That ensured a majority for Mr Sánchez, who already had the backing of a broad array of parties.
Mr Rajoy had spent eight hours huddled with colleagues in a restaurant near the congress building in central Madrid on Thursday evening, digesting the PNV's decision. on Friday, shortly before the vote, he gave his final speech to the chamber as prime minister, declaring that "it has been an honour to leave Spain in better shape than when I arrived."
Mr Rajoy also addressed the Socialist leader.
“We can assume that the motion will be successful,” he said. “That is why I would like to be the first to congratulate you. The chamber will decide and I, as a democrat, will accept the decision, but I cannot agree with the way it has been carried out.”
The PP has frequently queried the legitimacy of the confidence motion, claiming that the Socialists are also guilty of corruption. It has also warned that the motion could create an unwieldy "Frankenstein government" and destabilise the economy.
The leftist Podemos supported the motion. Its leader, Pablo Iglesias, who made an unsuccessful attempt to remove Mr Rajoy with a confidence motion last year, hugged Mr Sánchez after the result of the vote was announced. As well as the PNV, several regional nationalist groups also voted in favour, including the Catalan Democratic Party (PDeCat) of Carles Puigdemont, the exiled former president of Catalonia, and the Catalan Republican Left (ERC).
However, the centre-right Ciudadanos party voted against, echoing Mr Rajoy's warnings that it would bring turmoil.
"A new era of uncertainty, weakness and instability is beginning," said Ciudadanos leader Albert Rivera, who has criticised Mr Sánchez's willingness to accept the support of separatist parties. Ciudadanos, which is leading many opinion polls, has been lobbying for a snap general election.
“We are not afraid of the ballot box. We will be preparing ourselves to win until Sánchez dares call elections,” Mr Rivera added.
Mr Sánchez has promised to hold elections ahead of those previously scheduled for the end of the legislature, in 2020. But he has not specified when.
The new prime minister is due to be sworn in on Saturday and his cabinet, which he has said will be made up exclusively of Socialist appointees, will follow in the coming days.