The country’s new leader will preside over a minority government propped up by the leftist Podemos bloc and other parties, including Basque and Catalan nationalists.
Before being sworn in by Spain’s King Felipe VI on Saturday, Sanchez vowed to tackle the “social emergencies” experienced by Spaniards after years of austerity measures.
The inauguration marks the end of an unprecedent episode in modern Spanish history, which saw a serving prime minister fail to secure the confidence of parliament for the first time since Spain’s transition to democracy in 1977.
The 46-year-old former professor of economics has an arduous task before him as he seeks to allay financial market fears about political instability, as well as resolve a bitter dispute with Catalan nationalists, who declared independence after a referendum in 2017.
The Socialist (PSOE) leader has promised to respect the 2018 state budget passed by his predecessor and negotiate with the Catalans, so long as the unity of Spain is not up for question.
“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 said after the vote to remove Rajoy from office.
Spain’s once entrenched two-party system has given way to a splintering of left-wing and right-wing currents.
Rajoy’s PP has had to fend off the challenge from liberal upstarts Ciudadanos, while PSOE competes for the centre-left and leftist vote with Podemos.