01/06/2018 11:01 BST | Updated 01/06/2018 15:04 BST

Socialist Chief Pedro Sanchez Becomes Spain's Prime Minister

The former leader, Mariano Rajoy, was embroiled in a long-running corruption scandal.

POOL New / Reuters
Spain's new Prime Minister and Socialist party (PSOE) leader Pedro Sanchez shakes hands with ousted Prime Minister Mariano Rajoy after a motion of no confidence vote at parliament in Madrid

Socialist politician Pedro Sanchez has taken over as Spain’s prime minister, after the outgoing leader Mariano Rajoy lost a parliamentary confidence vote triggered by a long-running corruption trial.

Socialist party head Sanchez becomes Spain’s seventh Prime Minister since its return to democracy in the late 1970s following the dictatorship of Francisco Franco.

But Rajoy’s departure after six years in office casts one of the European Union’s top four economies into an uncertain political landscape.

Sanchez won Friday’s no-confidence motion with 180 votes in favour, 169 against and 1 abstention. He suggested on Thursday he would try to govern until the scheduled end of the parliamentary term in mid-2020.

But it is unclear how long his administration, with only 84 Socialist deputies in the 350-member assembly, can last.

The leftist party Podemos, which will offer parliamentary support to Sanchez’s government, is also unlikely to gain big influence over the new Prime Minister, who is keen to differentiate his Socialist party from its anti-austerity ally and win back centrist voters.

Rajoy had conceded defeat prior to the no-confidence vote, earlier telling deputies: “Mr Sanchez will be the head of the government and let me be the first to congratulate him.”

Rajoy’s position had become increasingly untenable, undermined by his status as head of a corruption-tinged minority government as well as a divisive independence drive in the wealthy region of Catalonia.

His fate appeared sealed Thursday night, with HuffPost Spain confirming that Rajoy had spent more than eight hours with his closest team in a downtown restaurant in Madrid as parliament debated his future - not emerging until after 10pm local time. 

Susana Vera / Reuters
Spain's former Prime Minister Mariano Rajoy is led to his car just after 10pm local time after spending more than right hours in the Arahy restaurant in central Madrid

The Basque Nationalist Party, whose five seats were key to Sanchez securing enough parliamentary backing, withdrew support from Rajoy after dozens of people linked to his center-right People’s Party (PP) were sentenced to decades in jail in a corruption trial.

Two Catalan pro-independence parties as well as Podemos also backed Sanchez. Market-friendly Ciudadanos, leading in the national opinion polls, was the only major party that supported Rajoy.

Sanchez, who is expected to be sworn in by Monday and appoint his cabinet next week, plans to establish a “dialogue” with the new Catalan Government to return to return the region to “normality”.

“I am aware of the responsibility I am assuming, of the complex political moment our country is going through and I will rise to all the challenges with humility and dedication,” Sanchez told reporters.

“I am willing to modernise and transform the country and to attend to the urgent social issues of the many people who suffer ...inequality.”

Passionately pro-European, Sanchez studied for a masters in economic policy in Brussels and he has worked in the European Parliament and the United Nations.

He has committed to respecting the European Union’s fiscal rules and has already endorsed Rajoy’s budget. His weak hand in parliament means he is also unlikely to rescind any of the structural reforms the conservatives passed.

Sanchez lost two national elections to Rajoy’s People’s Party in 2015 and 2016.

With files from HuffPost Spain in Madrid