Prime Minister Mariano Rajoy (right) was deposed as Spanish Prime Minister on Friday after losing a vote of no-confidence following a corruption scandal involving his ruling People's Party.
Rajoy, 63, must offer King Felipe VI his resignation, according to media reports, before his successor can take office.
In order to cobble together the support to cast out Rajoy, Sanchez promised to open talks with Torra in order to get the votes he needed from the Catalan pro-secession lawmakers in the national parliament.
As Spain's new prime minister, whose party only has a quarter of the seats in parliament, Sanchez now has to decide who to include in his cabinet.
Sanchez has vowed to fight corruption and help those Spaniards affected by years of public spending cuts under Rajoy's government.
But Mr Sanchez's appointment was quickly disrupted by Catalan's newly elected leader Quim Torra, who demanded the newbie meet him to negotiate wealthy Catalonia becoming an independent state.
Sanchez had been Rajoy's most loyal backer of a government takeover of Catalonia's regional affairs following an illegal - and unsuccessful - declaration of independence by the region's parliament in October.
Socialist leader Sanchez wins vote to oust Spanish PM Rajoy
The bespectacled 63-year-old leader got up and shook hands with Sanchez before leaving the lower house without a word. The Spanish constitution states that the party which presents a no-confidence motion must be prepared to govern.
Besides inheriting Spain's worst political crisis in almost four decades, Sanchez's government will depend on the support of the far-left Podemos (We Can) party and of a motley crew of regional parties and Catalan secessionists to get anything done in the federal government.
Although he was re-elected as party head during primaries in May a year ago, the Socialists were often sidelined as Podemos, the centre-right Ciudadanos and Mr Rajoy's PP took centre stage in politics.
The reputation of Rajoy's Popular Party had been largely damaged after a court verdict said it was a beneficiary of a massive kickbacks-for-contracts scheme.
"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. At a voting 180 MPs backed the no-confidence motion, 169 opposed and one abstained.
Mr Sanchez will only be able to implement policy initiatives "that allow him to obtain an easy majority" in Parliament, said Professor Fernando Vallespin at the Autonomous University of Madrid.
Mr Sanchez and his party are staunch supporters of the European Union and the shared currency.
Sanchez, 46, pledged to "fulfill his duties conscientiously" and be loyal to the king and the country's Constitution.