Struggling to overcome their differences, representatives from both parties raced against the clock to try and secure a deal for what would be Spain's first post-dictatorship coalition government.

Sanchez, who came first in an April national poll but won just 123 parliamentary seats out of 350 -- short of a majority -- lost a first post-election confidence vote on Tuesday.

In a second, decisive vote on Thursday, the socialist premier needs Podemos's 42 lawmakers to back him, as well as a few others from regional parties.

But in exchange, Podemos wants to be in his government.

Some of the other potential allies have conditioned their support on Sanchez reaching a deal with Podemos.

If the talks fail and Sanchez cannot secure the votes he needs, he has another two months to find a solution, failing which the Spanish will face another general election -- the fourth in four years.

Difficult talks

On Wednesday, Spain's caretaker deputy prime minister Carmen Calvo met Pablo Echenique, head of negotiations for Podemos, said a source at the far-left party who refused to be named.

The source said Podemos "doesn't want to enter government at any price."

The party has said it made several concessions already.

Its leader Pablo Iglesias, who notoriously does not get along with Sanchez, agreed earlier not to be part of the government so as to unblock the situation, for instance.

But still Podemos has accused the socialists of refusing to give them positions that carry any weight.

Podemos would like the post of deputy prime minister, which the party's number two Irene Montero -- also Iglesias's partner -- could take on.

It would also like positions of responsibility in the fields of equality, taxation, labour and the environment, the source said.

The Socialist party (PSOE), meanwhile, has remained tight-lipped about the content of the talks.

In a speech on Monday, Sanchez outlined a future government programme with a lot of social spending in what was seen as a bid to woo Podemos.

He pledged to increase the minimum wage again, which stands at 1,050 euros ($1,170) a month since January, adjust pensions to inflation, boost investment in education to five percent of GDP, among other measures.

Tough road ahead

Right-wing opposition parties have lashed out at Sanchez's plans to form a government with Podemos.

Albert Rivera, leader of the liberal Ciudadanos party, accused him of "putting together a Frankenstein government."

And the road ahead looks tough.

"If a coalition is finally formed this week and Sanchez wins the confidence vote, the room for big economic policy changes would nevertheless remain limited given that PSOE and Podemos would still lack a majority in the highly-fragmented lower chamber," said Antonio Barroso, deputy research director at consultancy Teneo.

"In fact, the inclusion of Podemos in the government will only further limit Sanchez' space to negotiate policy changes in parliament," he said, pointing to the antagonism between right-wing parties and their far-left counterpart.

"While Ciudadanos might have felt inclined to support specific government initiatives, the potential presence of Podemos in the new cabinet eliminates such a possibility given the antagonism between the two parties," he added.