Spain's prime minister, Pedro Sánchez has resigned as the leader of the Spanish Socialist Workers's party (PSOE) hours after being defeated in the snap general he called in one of his characteristic gambles.
Sánchez, who has been in office for eight years, announced his decision to colleagues during a meeting of the PSOE's executive committee on Monday morning.
PSOE sources confirmed to the Guardian that Sánchez is to stand down.
According to a report in El País, an interim leadership will take over and run the party between now and the regional and municipal elections in May.
Meanwhile in Sweden, the leader of centre-right Moderates Ulf Kristersson has been confirmed as the country's returning prime minister.

Despite a group of centre-left parties winning the election in September, they could not agree on a way forward or the government's composition, with the centrist Centre party eventually pivoting to form an alliance with a group of centre-right parties – and keep Kristersson in the top job.
There is no official role for the far-right Sweden Democrats, who will support the government from the outside, though the administration may well need their votes to pass key legislation – so let's see how those dynamics play out.
More tributes for Sánchez are coming in (13:30), with Italy's former prime minister Giuseppe Conte praising his track record in government.
"I do not forget.
Pedro Sánchez stood by Italy when, in 2020, we were fighting on the front lines for the €209 billion in the National Recovery and Resilience Plan, during one of the most difficult periods in European history.
He did not turn his back even under the Meloni government, when our country was in crisis over the surge in arrivals on Lampedusa in 2023.
He knew how to say no and take a stand when it certainly was not easy, from rearmament to the genocide in Gaza.
Over the years, he pursued courageous policies that have helped his country grow and strengthened citizens' rights, and he has also raised the minimum wage several times.
Today, Sánchez is losing in Spain, and Italy is certainly losing a friend.
Pedro has my respect and my gratitude."
Spain's high profile in the EU is likely to blur into the background in Brussels with changes in policies aligning closer to the centrist views in the bloc, academic experts have said.

Speaking at a UK in a Changing Europe briefing on Spain in London , politics lecturer at King's College, said:
"I think Spain may go back to being a 'middle of the pack' country in the EU. What people forget is that Sánchez was creative with policy, he was a leader."
She particularly noted the differentiations he brought to policy in the EU on issues such including immigration, defence and Israel.
She said Sánchez may have been an uncomfortable bedfellow for the centre right in the EU, but on many fronts he was successful – the economy had grown driving by tourism and immigration and employment went down.
Despite the perennial charges of corruption, Sánchez was "not as cosy with the banks and developers" and introduced policies on abortion, gender based rights including more women to boardrooms, and parental leave, though he was slow on housing, she said. He had also strengthen the place of unions in the workforce.
A new government which aligns with the bigger countries in the EU will not be so visible.
"I do think that, for all the criticism that Pedro Sánchez received, we really saw a government that governed on the left," she said.
Rightwing leaders across Europe have leapt on the victory of the People's party (PP) and Vox in Spain's general election as a signal of a "patriotic wave" set to sweep across the continent, as they look ahead to major elections in some of the EU's largest countries over the next 12 months.
the frontrunner in next year's French presidential election, said that through working with Vox – a fellow member of the Patriots for Europe group in the European parliament – her National Rally party would promote an EU that "protects its borders, its workers and its identity".
"Every victory by our allies brings closer the moment when this project will command a majority at the very heart of the European institutions," Le Pen said, as she hailed the Spanish election results as confirmation that a "patriotic wave is sweeping across Europe".
Speaking before the results came in, Alice Weidel, co-leader of Germany's far-right Alternative für Deutschland (AfD), said: "All of Europe is waiting for a political shift in Madrid."
Telling voters that Europe was counting on them, Weidel looked ahead to the election by saying that the "great Spanish nation must not perish".
Italy's prime minister, Giorga Meloni, congratulated her "friends" Alberto Núnez Feijóo and Santiago Abascal, the leaders of the PP and Vox respectively, and hailed the election's turnout of more than 78% – a 40-year record – as a "welcome sign for all of Europe of democratic vitality".
While the right are celebrating Sánchez's departure, we are also seeing a flurry of tributes to Spain's prime minister of the last eight years – who was the last centre-left leader of a major Eurozone country.
Sánchez championed progressive policies on migration, housing and climate change and was a prominent critic of Israel's war in Gaza.
, one of Sánchez's former deputy prime ministers who is now the EU's green transition chief has written:
Spain is a better country today than the one you found - even if the world has come crashing down on us a few times between 2018 and now. Thank you."
the socialist president of Catalonia, who served as Sánchez's health minister during the Covid pandemic posted:
Your leadership has moved the country forwards on rights, progress, and coexistence. From Catalonia, we will continue to promote this path of progress and defend a plural and plurinational Spain against those who wish to take it backwards.
While both parties have campaigned on cutting taxes, tackling immigration and fixing the housing crisis, it remains to be seen how well they can work together – and how tolerant the PP will be of some of Vox's more extreme ideas.
Vox also has a track record of abandoning regional coalitions when the PP refuses to yield to its demands.
Two of the pillars of Vox's campaign were promises to enact a "remigration" policy and to ensure that Spaniards receive "national priority" over those from abroad when it comes to accessing housing and benefits.
Vox has also shown a tendency in regional government to censor or defund cultural projects and activities that it rejects on ideological grounds – something that could prove awkward for the supposedly centre-right PP.


Sánchez will stay on as caretaker prime minister while the PP and Vox try to hammer out an agreement to govern jointly.
Although the two parties share power in four Spanish regions, negotiations over a national coalition are likely to require a lot of compromise and horse-trading.
Vox will aim to extract maximum benefit for propping up a PP-led government, including taking charge of a few ministries.
The newly elected congress and senate will convene on 23 December. Then King Felipe VI will meet party leaders to determine which candidate could win MPs' backing to become the next prime minister.
If, as expected, that candidate is the PP leader, Alberto Núñez Feijóo, he will submit himself to an investiture debate followed by a vote that requires an absolute majority in congress – the aforementioned 176 seats.
If he falls short of that number, a second vote will be held 48 hours later in which a simple majority – more votes for than against – will suffice. Should that fail to happen, MPs have two months to appoint a prime minister. When those two months are up, parliament will be dissolved and new elections called.
And this in too, from the leader of the far-right Vox party, Santiago Abascal.
He's posted on X: "Mission accomplished. Sánchez is out!"
The man most likely to be Spain's next PM, Alberto Núñez Feijóo, has just posted on X.
"Respect is the only appropriate response to Sánchez's resignation," the PP leader wrote.
"Spain is turning the page. Now, we should only look back at the past so as not to repeat it. The walls are coming down."
The snap election has led to not only the removal of the last centre-left leader of a major EY country, but also terrible results for left-wing parties in general.
Although the PSOE only dropped five seats on its results in the last election three years ago, the parties to its left struggled to attract the support they had been hoping for.
The Broad Front, which had unsuccessfully sought to persuade the leftwing party to join its ticket, said it hadn't had enough time to prepare.
, which grew out of the Indignados movement and went on to govern alongside Sánchez, saw its support collapse and found itself unable to secure a single seat.
, a new liberal, centrist party led by the Spanish lawyer Miriam González Durántez, also failed to win a seat in its electoral debut.