Despite months of failed negotiations between the two parties in the wake of the general election in April, forcing Sanchez to call a repeat general election, the two leaders have defied expectations and made a deal within 48 hours of the vote.
The pair signed a deal on Tuesday shortly before 2.30pm after holding secret meetings on Monday night. It will see Pedro Sanchez as Prime Minister with Pablo Iglesias take the role of Deputy Prime Minister.
“As I said on election night after hearing the results, what was a historical opportunity in April has become a historical necessity,” said the Unidas Podemos leader.
“I’m pleased to announce today, together with Pedro Sánchez, that we have reached a preliminary agreement to create a progressive coalition government that combines the experience of the PSOE with the courage of Unidas Podemos.”
Sanchez added that the deal would form a “progressive government made up of progressive forces that are going to work for progress. There is no room for hatred between Spaniards,” he said.
He said the deal was for the government to last for four years, “the entire term”.
The two leaders hugged in front of the cameras after signing the pact.
?️ Pedro @sanchezcastejon: “El nuevo Gobierno será estable y rotundamente progresista”
— PSOE (@PSOE) November 12, 2019
In the coming weeks, the two parties would thrash out all the details of both the structure and the programme of the government, Sanchez added.
The pair will need the support of other factions in order to pass an investiture vote with at least 176 votes in the 350-seat parliament.
Although Sanchez's Socialists won Sunday's vote, the fourth in as many years, he emerged from the elections weakened. The repeat vote boosted support for the rightwing People's Party and propelled the far-right Vox into third place.
Both the Socialists and Podemos lost seats compared to April's election.
Sanchez's party took 120, down from 123, while Podemos secured 35, down from 42, leaving the two factions 21 seats short for any investiture vote.
The coalition would need the support of Ciudadanos, which won just ten seats (down from 57) as well from smaller regional parties.
But Ciudadanos was quick to criticise and seemed to immediately rule out backing a Socialist-Podemos alliance.
“Ciudadanos cannot support Sanchez and Podemos holding the reins of Spain's government,” a party statement said, saying it would be “detrimental to the interests of most Spaniards”.
And like others, it harked back to a September interview in which Sanchez justified his decision to call an election and refusal to work with Podemos
In it he said he wouldn't sleep at night if he formed a coalition with a party that had so “little experience of politics”.
“Not so long ago, he said he couldn't sleep with the idea of Podemos and now they're going to live together,” the party said, in remarks which were echoed by PP leader Pablo Casado.
“It no longer worries him that Pablo Iglesias will be in his government but there are many Spaniards who will be worried by this deal that they've just announced,” Casado tweeted.
Following the announcement, the Ibex 35 index of most-traded Spanish shares went into the red, and soon after was trading about 0.80 percent lower, with banking stocks particularly affected on concerns the alliance could hike taxes on the sector.