MADRID (Reuters) - Spanish socialist Pedro Sanchez was catapulted to power on Friday, taking over as prime minister from veteran conservative Mariano Rajoy, who lost a no-confidence vote in the wake of a corruption scandal.

Lawmakers stood and cheered in parliament as the untested 46-year-old - a pro-European lawmaker who has never been in government - became the country’s seventh head of government since its return to democracy in the late 1970s.

Rajoy’s departure after six years in office may lead to a spell of political uncertainty in the euro zone’s fourth-largest economy, just as the third-largest - Italy - pulls back from early elections.

“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.

Sanchez, who became prime minister with only 84 seats for his Socialists in the 350-member assembly thanks to support from the hard-left Podemos and smaller nationalist parties, said he intends to steer the country through to mid-2020 when the parliamentary term ends.

But his majority - the smallest for a Spanish government since the return to democracy following Francisco Franco’s death in 1975, makes it unclear how long his administration can last.

His strong pro-European credentials, and the fact that Rajoy also ran a minority government, suggest fallout from any political ructions is likely to be limited.

Spain’s stock market rose after the parliamentary vote, to trade nearly 2 percent higher on Thursday’s close, while the country’s borrowing costs fell, soothed by Sanchez’s commitment to respecting a fiscally conservative budget passed by Rajoy.

“Sanchez has reiterated a commitment with European orthodoxy and budget control in Spain,” UBS analysts said. “We do not anticipate a substantial impact on the pace of growth.”

Anti-establishment parties in Rome revived coalition plans on Thursday, ending three months of turmoil by announcing a government that, by contrast, says it will increase spending and challenge European Union fiscal rules.

In Berlin, a government spokesman said Germany hoped for a stable government in Madrid.

PRO-EUROPE

The socialists’ unlikely leap into office, unexpected just a few days ago for a party that lags the center-right Ciudadanos and Rajoy’s conservative People’s Party (PP) in opinion polls, was precipitated by last week’s sentencing of dozens of people linked to the PP to decades in jail in a corruption trial.

Slideshow ( 12 images )

Anger with corruption allowed Sanchez to win Friday’s no-confidence motion by 180 votes to 169, with one abstention.

But the fragmented parliament means he will find it hard to row back on structural reforms passed by his predecessor, including new labor laws and cuts in healthcare and education.

The anti-austerity Podemos, a product of widespread anger at spending cuts imposed by Rajoy’s first government at the height of the euro zone crisis, has promised to support Sanchez in parliament.

Slideshow ( 12 images )

But the hard-left party seems unlikely to gain major influence over Sanchez, who is keen to win back centrist voters.

CATALONIA TALKS?

Outgoing premier Rajoy conceded defeat prior to the no-confidence vote, congratulating Sanchez and telling deputies in a short speech: “It has been an honor to have left Spain in a better state than I found it.”

The 63-year-old veteran took over the government in 2011 in the middle of a deep recession and presided over a dramatic economic recovery.

However, his position had become increasingly untenable, undermined by scandals encircling his party as well as an independence drive in the wealthy region of Catalonia, which led Madrid to impose direct rule on the region last autumn.

Two Catalan pro-independence parties backed the motion of no-confidence in Rajoy.

Sanchez, who will be sworn in on Saturday, is expected to appoint his cabinet next week, has promised to start talks with the Catalans but has said he will not give the region an independence referendum.

On Friday, Catalan authorities announced their new cabinet, hoping to pave the way for Madrid to end its direct rule.

German prosecutors on Friday made a court application for the extradition to Spain of the leader of Catalonia’s independence movement, former regional president Carles Puigdemont, on charges linked to his role in the region’s independence drive.