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.
Sánchez has just delivered a brief statement after a meeting of the party's executive, announcing that he will also not be taking up his seat in the new parliament.

"Today, I'm taking the first step so that this great party – this century-old party that has survived dictatorships, exile and defeats far harsher than this one – can rise to its feet once again, as it always has, and embark on a new beginning," he said.
"From now on, I'm just another party member."
He defended his track record, saying that despite all the crises he had faced – from wars to the Covid pandemic – he had done his best for Spain.
"Despite all these difficulties and complexities, despite all these challenges, I honestly think we're handing over a better Spain that the one we found in 2018."
Sánchez, who was famed for his talent for confounding expectations and wrongfooting his rivals, called Sunday's election in the hope of shoring up his support among progressives by seeking to focus the vote on his efforts to solve Spain's housing crisis.
He had also been hoping that the election would help him move past the corruption allegations facing his inner circle, and past his government's much-criticised response to the events of the summer in Spain's North African territory of Ceuta, where about 80,000 people crossed over the border from neighbouring Morocco.
But his opponents in the conservative People's party (PP) and the far-right Vox party sought to portray the poll as a referendum on what they disdainfully refer to as "", arguing the style of government favoured by the prime minister and his allies is cynical, corrupt, opportunistic and self-serving.
As widely predicted, the PP finished first on Sunday night, winning 132 seats but falling well short of an absolute majority in Spain's 350-seat congress. The PSOE came second, picking up 116 seats, while Vox won 52 and the leftwing Broad Front coalition won 10.
Between them, the PP and Vox now have 184 seats – well above the necessary majority of 176 seats – and are now expected to seek to form a coalition government.
If a deal is struck, it would mark the return of the far right to government in Spain for the first time since the country's transition to democracy following the death of Gen Francisco Franco in 1975.
Speaking after the party executive's meeting, Sánchez also confirms he will not take his seat in the new parliament.
More on this shortly.
in Madrid
During last week's televised debate, PP's leader Alberto Núñez Feijóo challenged Sánchez, saying he would resign from his post and give up his seat if his party lost – and asked the PM to pledge he would do the same.
Sánchez said no at the time as he rejected the right's preferred framing of this election as a referendum on "" – but clearly felt he needed to step down this morning.
Is it just me, or is that in slight contradiction with his focus on hope, defiance and not giving up in his concession speech last night?

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.
in Madrid
Pedro Sánchez has resigned as leader of the PSOE, the Guardian has confirmed.
Oh-oh.
We are getting a line that Pedro Sánchez has resigned as PSOE's leader following last night's electoral defeat.
This is being reported by El País, which says he announced his resignation at a meeting of the party's leadership.
We're looking to confirm this for you.
In recent years, Sánchez had styled himself as a progressive counterweight to the steady march of the far right, adding a global dimension to Sunday's election, said Nic Lawley, a special adviser with the Chatham House thinktank.

"It's a real centre point of the battle between the global left and the global right," he said, pointing to the campaign appearances by Argentina's and Brazil's .
On Sunday one of the first world leaders to address the results was Donald Trump, who hailed Sánchez's loss. "That's a good thing. He did a terrible job. He deserves to lose," the US president told reporters. "That's great news."
The election came months after Sánchez made headlines around the world for vociferously pushing back against Donald Trump's war in Iran, adding to his rejection, months earlier, of Trump's demand for Nato states to increase their defence spending to 5% of GDP.
Spain had been the last major EU country that was in socialist hands, said , the head of the Madrid office and policy fellow at the European Council on Foreign Relations.
"It still will have it a bit tricky to accommodate Vox but now that the European centre right has shifted quite significantly right on issues like migration or on decarbonisation, I think it will enable the PP to accommodate Vox in a way that it might have found more challenging a few years ago in the European context," she said.
The far right looks set to enter a Spanish government for the first time since the end of the Franco dictatorship after Pedro Sánchez's gamble on calling a snap election backfired, delivering a majority to the conservative People's party and its allies in the far-right Vox party.

The PP had promised to lower taxes, build 1m homes, and "restore the country's ambition and self-esteem".
In turn, Vox's manifesto, which focused on deregulation, "remigration" and on giving Spanish-born people priority over those born abroad for housing and public services, also included proposals to prosecute Sánchez and his government "for treason and crimes against the security of the state" over the Ceuta mass crossing.
Despite the fact that the PP's previous leader, publicly excoriated Vox and its ideology six years ago, accusing the party of peddling a politics based on "fear, anger, resentment and revenge", the PP has repeatedly formed regional coalition governments with Vox and currently runs four of Spain's autonomous regions with the party.
in Madrid
Spain is waking up to the prospect of a new rightwing government backed by a far-right party for the first time since the country's return to democracy in the 1970s.
Quite a shift from brand of progressive politics.

The conservative People's Party, led by 65-year-old former regional president of Galicia won last night elections with 132 seats in the new parliament, way ahead of Sánchez's PSOE with 116.

To govern Spain, Feijóo will need the anti-immigrant far-right Vox party – with which it has some experience of working together on a local level – which came third and substantially increased its representation from 33 to 52 seats.

The two parties together, joined by PP's partner in UPN, will have 186 seats, well clear of the 176 required for majority.
The process of forming the next government will take a while, with Sánchez staying on as a caretaker as the country figures out its next step.
But the opposition win – even if expected – will have significant global consequences and adds to the growing momentum of the right as Europe enters its electoral super cycle, with elections in three other major EU states in the next 12 months.
Let me bring you all the reactions and early analysis here as we try to make sense of what's next.
We are also expecting news from Sweden later today, where the outgoing conservative prime minister is expected to be confirmed as the new PM, despite the centre-left bloc winning the election in September.
It's , it's here, and this is .