Spain's Socialist chief Pedro Sanchez was sworn in as prime minister on Saturday after ousting veteran conservative leader Mariano Rajoy, with Catalonia's separatist president promptly calling for talks over the region's independence drive.
Mr Sanchez, a 46-year-old economist with no government experience, has made a spectacular comeback to the front line of politics. But he faces a tough road ahead, leading a minority government with support of diverse parties ranging from far-left Podemos to Catalan separatists.
He took the oath of office before King Felipe VI in the Zarzuela Palace near Madrid in the presence of Mr Rajoy just a day after toppling him in a historic no-confidence vote.
That move was sparked by fury over a corruption scandal that struck Mr Rajoy's conservative Popular Party (PP).
"I promise to faithfully fulfil the duties of the post of prime minister with conscience and honour, with loyalty to the king, and to guard and have guarded the constitution as a fundamental state rule," he said.
He was the first Spanish prime minister to take the oath without a Bible or crucifix.
Mr Sanchez has yet to name his cabinet and it is only when their names are published in an official government journal in the coming days that he will fully assume his functions.
No sooner had he taken office than Catalonia's separatist president Quim Torra called for talks.
The wealthy region's independence drive shows no sign of dying down despite deep divisions among its 7.5 million inhabitants.
"Prime Minister Pedro Sanchez, let's talk, let's address this issue, let's take risks, you and us," Mr Torra said.
He spoke as his own regional executive was sworn in at an emotional ceremony in Barcelona.
Many participants wore yellow, the colour that has come to symbolise the separatist cause.
"We need to sit down at the same table and negotiate, government to government," Mr Torra said.
"This situation we're going through cannot go on for even one more day."
As opposition leader, Mr Sanchez was deeply critical of Catalonia's secession bid. He backed Mr Rajoy's imposition of direct rule on the region in October after separatist leaders declared independence.
But he softened his tone as Catalan separatist lawmakers in the national parliament backed his no-confidence motion. He has said he wants to "build bridges" with the new regional government.
The EU-friendly Mr Rajoy, 63, had been in power since 2011. His ousting comes at a time of political instability in Europe, with a new eurosceptic, anti-establishment government taking office in Italy.
Mr Sanchez has promised his "main priority" will be to respect Madrid's deficit reduction commitments to the European Union.
He has also vowed to implement the 2018 budget drawn up by Rajoy's government.
His arrival at the prime minister's office crowns an astounding comeback.
Mr Sanchez led the Socialists to two crushing general election defeats in 2015 and 2016, and was forced out by fellow members – but re-elected him as party head in May 2017.
Even then the Socialists were often sidelined as Podemos, centre-right Ciudadanos and Mr Rajoy's PP took centre stage in politics.
That all changed on May 25 when the Socialists filed a no-confidence motion against Mr Rajoy.
The move came a day after a court found former PP officials guilty of receiving bribes in exchange for awarding public contracts in a vast graft scheme between 1999 and 2005.
An absolute majority of 180 lawmakers voted for the motion on Friday to loud applause and shouts of "Yes we can".
Mr Sanchez vowed to tackle "all the challenges which the country faces with humility".
Tough road ahead
Mr Sanchez may struggle to govern, however, as his Socialists have just 84 seats in the 350-seat parliament.
All of his allies in the no-confidence motion stressed their vote against Mr Rajoy was not a blank cheque for Mr Sanchez.
"Our 'Yes' to Sanchez is a 'No' to Rajoy," Joan Tarda of Catalan pro-independence party Esquerra Republicana de Catalunya (ERC) told parliament.
Mr Sanchez will only be able to implement policy initiatives "that allow him to obtain an easy majority" in parliament, said Fernando Vallespin, political scientist at the Autonomous University of Madrid.