Pedro Sanchez won the backing of Spain's parliament on Thursday for another term as prime minister, with the country divided over his decision to grant Catalan separatists an amnesty in exchange for their crucial support in a vote of confidence.
Sanchez, in office since 2018, won the backing of 179 lawmakers, three more than the absolute majority of 176 in the 350-seat parliament after an often tense two-day debate.
His Socialist party finished second in an inconclusive July general election but he reached deals with several smaller parties to back re-establishing his minority coalition government with hard-left party Sumar.
To win the support of two Catalan separatist parties, he agreed to grant amnesty to hundreds of people facing legal action for their role in Catalonia's separatist movement over the past decade.
Puigdemont organised referendum that was banned by the central government, followed by a short-lived declaration of independence that sparked Spain's worst political crisis in decades.
Puigdemont fled to Belgium to avoid prosecution. An amnesty would allow him to return to Spain, while many Spaniards consider him an enemy of the state.
Sanchez, who has made a career out of making political gambles, defended the amnesty during the parliamentary debate, arguing it was constitutional and needed to "heal the wounds" opened by the wealthy northeastern region's independence push.
"We will guarantee the unity of Spain through dialogue and forgiveness," the 51-year-old added.
Critics argue the amnesty is a self-serving measure to allow Sanchez to remain in power and accuse him of trampling on the rule of law.
"Adopting measures that go against the general interest in exchange of personal benefit is political corruption," the leader of the conservative Popular Party (PP), Alberto Nunez Feijoo, said during the debate.
The PP won most seats in the July election but fell short of a majority and Feijoo was unable to get support from other parties to win his investiture vote in September.
The leader of the far-right Vox party, Santiago Abascal has called the amnesty deal a "coup d'etat".
Several polls show over half of all Spaniards oppose the amnesty, that has prompted a wave of nationwide protests.
Hundreds of thousands of people took part Sunday in different protests, answering a PP call to take to the streets.
Thousands have congregated each night for over a week outside the Socialist party's headquarters in Madrid in rallies organised by the far-right. Some protests have turned violent.
Fifteen people were arrested at the protest on Wednesday night following scuffles with police.
No 'blank cheque'
In a sign of the tensions, over 1,600 police were deployed on Wednesday and Thursday for the parliamentary debate, according to the interior ministry.
Sanchez - one of Europe's longest serving Socialist leaders - also outlined some of his economic plans for his new term on Wednesday.
These include making public transport free for young people and the unemployed, and continuing to link pension hikes to inflation.
But he will likely struggle to pass legislation since the various leftist and regional parties slated to back him on Thursday have radically different ideologies.
A spokeswoman for leftist Basque independence party Bildu, Mertxe Aizpurua, warned Thursday that her party's yes vote for Sanchez would not be a "blank cheque".
Feijoo, the leader of the PP, said Sanchez will have to negotiate support for each bill he seeks to pass and will not really be "in control" of the government.