Spanish caretaker prime minister, socialist Pedro Sanchez | Pierre-Philippe Marcou/AFP via Getty Images Spain’s Sánchez loses first vote to be confirmed PM But Socialist leader hopes to win second vote on Tuesday.

Spain's Socialist leader Pedro Sánchez failed on Sunday to get parliament's support to form a government, but aims to win in a second vote on Tuesday.

Sánchez has been serving as acting prime minister since an inconclusive election in April, and a subsequent snap election in November. He needed an absolute majority on Sunday of at least 176 votes in his favor in the 350-seat Congress of Deputies to be confirmed as prime minister, but fell short with 166 votes in favor, 165 against and 18 abstentions. One lawmaker also did not attend.

He's expected to win in a second vote set for Tuesday where he will only need a simple majority — more "yes" than "no" votes — after the separatist Catalan Republican Left (ERC) agreed last week to abstain. Their abstention will enable Sánchez to secure enough support in parliament to form a coalition with the leftist Podemos — the first coalition government in the country's recent history.

Doubts had been raised about the ERC's intention to abstain after Spain's electoral commission decided last week to strip Catalan President Quim Torra — an ally of the party — of his position as a regional lawmaker, and to bar the ERC’s jailed leader and elected MEP Oriol Junqueras from office, despite an EU court ruling. But the ERC on Saturday reaffirmed their plans to abstain under a deal struck with the Socialists for the Spanish and Catalan governments to start negotiations on a solution to the political turmoil in the region.

The Socialists and Podemos have said they plan to push for tax hikes on high-income earners and companies and also intend to roll back labor reforms passed by a previous conservative government.