Socialist Pedro Sanchez took over as Spain's prime minister on Friday, after outgoing leader Mariano Rajoy lost a parliamentary confidence vote triggered by a long-running corruption trial involving members of his centre-right party.
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, just as another - Italy - pulled back from early elections.
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 legislative assembly, can last.
With most Spanish parties and Sanchez himself being pro-European, investors however see less broader political risk there than in Italy.
Anti-establishment parties in Rome revived coalition plans on Thursday, ending three months of turmoil by announcing a government that promises to increase spending, challenge European Union fiscal rules and crack down on immigration.
"We've had a rude awakening of European political risks this week... but the situation in Spain is very different from Italy," said Michael Metcalfe, head of global macro strategy, State Street Global Markets.
"The parties leading in the polls in Spain are centrists so we're not getting the proposals for fiscal extremes as we have in Italy."
Many observers said Sanchez was in any case unlikely to call any vote until after European, local and regional elections take place in May next year.
He has already committed to respecting a budget passed by Rajoy, and the fragmented parliament means Sanchez will find it hard to row back on structural reforms passed by his predecessor, including new labour laws and cuts in healthcare and education.
Leftist 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.
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 centre-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, has promised to start talks with the Catalans but said he will not give them an independence referendum.