PEDRO Sanchez has been confirmed as prime minister of Spain’s first coalition government since the 1930s after MPs voted 167 to 165 in Congress, with 18 abstentions.

He had failed to gain an absolute majority in Sunday’s vote for a coalition between his Socialist party (PSOE) and the left-wing, anti-austerity Podemos.

After swearing the constitutional oath before King Felipe, Sanchez will officially unveil his Cabinet in the next few days.

READ MORE: Pedro Sanchez to be Spain's PM as Catalan indy MPs abstain

Five of them have been proposed by his coalition partners.

The Republican Left of Catalonia (ERC), whose leader Oriol Junqueras is serving a 13-year jail sentence over the 2017 indyref, abstained to allow Sanchez to take office.

Montse Bassa, whose sister, former Catalan minister Dolors Bassa, is also in prison, said she did not “give a rat's ass” about Spain's governability, but said dialogue with the PSOE was worth a try.