Spain's Socialist party has signed an agreement with liberal newcomer party Ciudadanos to support the Socialists' bid to form a government next week - but they are still way short of a majority.
The pact made on Wednesday includes a programme of more than 200 measures, including constitutional reform.
"There is a first deal with Ciudadanos, there are way more groupings that can make [Socialist leader Pedro Sanchez's] investiture possible," Oscar Lopez, the Socialists' Senate spokesman, told Spanish radio.
Spain has struggled to form a government since inconclusive polls on December 20.
OPINION: Podemos and the Catalan cause
Sanchez can now count on his party's 90 seats and 40 from Ciudadanos in the 350-seat lower house of Parliament.
The agreement includes a set of reforms to be made by the next government. Sanchez declined to comment on whether it might ruin any possibility of an agreement with far-left newcomer Podemos.
But the conservative Popular Party, with 123 seats, has said that it will vote against Sanchez, while Podemos, which has 69 seats, said on Tuesday that it would vote against him if he did a deal with Ciudadanos.
The Socialists were to continue talks with Podemos on Wednesday in the hope of reaching an agreement.
Ciudadanos leader Albert Rivera said the two parties would work towards persuading others to come on board.
The Socialists' main difference with Podemos is the latter's insistence on allowing the northeastern Catalonia region to hold a referendum on secession.
Sanchez will present his government plans for debate in parliament on Tuesday, one day before facing a vote of confidence, which he must win with a majority.
READ MORE: Spain PM Rajoy declines king's offer to form government
If he fails, a second vote takes place two days later when he only needs more votes in favour than against.
If he wins neither, the parliament must choose a government in two months or face fresh elections.
The ruling Popular Party came first in the December 20 election but its leader, acting Prime Minister Mariano Rajoy, refused to try to form a government, saying he lacked sufficient support.
The elections, with the emergence of Podemos and Ciudadanos, led to Spain's most fragmented parliament in decades and shattered the dominance of the Popular Party and the Socialists.