Spain's Socialists have reached a preliminary agreement with the far-left Podemos party to form a coalition government following Sunday's election, a senior Socialist source said Tuesday.

The election — the country's fourth in four years — left Spain's parliament even more fragmented than a previous ballot in April, with the Spanish Socialist Workers' Party (PSOE) retaining its lead but further away from a majority.

If the unexpectedly quick deal is confirmed, this would be Spain's first coalition government since the country's return to democracy in the late 1970s.

However, the combination of the 120 seats obtained by the Socialists and the 35 of Unidas Podemos would not be enough on its own to secure a majority in the 350-seat parliament.

El Diario newspaper said they would try to get other parties on board, including the market-friendly Ciudadanos, far-left Mas Pais and the Basque nationalist PNV.

Acting Prime Minister Pedro Sanchez and Unidas Podemos leader Pablo Iglesias will meet later in the day, the Socialist party said in a statement. A joint declaration will follow.

The two parties had tried and failed to strike a government deal after the April election, which had prompted Sanchez to call the repeat election.

Spanish media including La Sexta TV said that Iglesias would be deputy prime minister, something which Sanchez had refused in the post-April election talks. Sanchez had also at the time opposed a coalition government.