Spain's Socialists (PSOE) and left-wing Unidas Podemos (UP) have reached a coalition agreement, the parties' respective leaders announced on Tuesday.

If endorsed by parliament, it would be Spain's first coalition since the re-establishment of democracy in 1977, and its first government to have lawmakers from far-left parties.

The deal was announced by PSOE leader Pedro Sanchez — who has been Spain's acting prime minister since 2018 amid ongoing political deadlock — and UP leader Pablo Iglesias.

Spanish media reports said the agreement includes a role for Iglesias as deputy prime minister, something Sanchez had refused had to consider after a similarly inconclusive election in April.

Sanchez said he start talks with additional parties to reach a majority.

Political stalemate and the rise of the right: what you need to know about the Spanish Election

A 155-strong coalition of PSOE (120) and Unidas Podemos (35) is far from the required majority of 176 seats and the coalition would need 21 more lawmakers to form a government in the first vote.

It is expected the deal will have the backing of four additional deputies — three from new left-wing coalition Más País and one from the Regionalist Party of Cantabria.

However, The People's Party, the far-right Vox and the liberal Citizens have already said they will oppose the coalition, which means Sanchez will depend on the votes of small parties such as Basque nationalists (7) or the Catalan independentists ERC (13).

After Tuesday's announcement, Spain's Ibex-35 index slipped by around 0.9%, having previously traded 0.3% higher on the day. The market has always looked less favourably on a coalition between the Socialists and Podemos than a centre-right coalition. During its campaign, Podemos opposed the privatisation of state-controlled lender Bankia, whose shares were trading 4.5% lower.

November 10 general election results: