Catalonia's oldest and largest separatist party, the ERC, demanded the negotiations over the region's place within Spain in exchange for its crucial abstention in a confidence vote last week that saw Sanchez sworn in for another term.
Under the deal, his Socialists agreed to open talks between the central and separatist governments to “unblock the political conflict over the future of Catalonia”, and then put to a regional vote any agreements which these negotiations produce.
“The Catalan question has been Spain's main problem for the past five or six years and it is the first time that someone decides to tackle it through a negotiation,” said Ernesto Pascual, professor of political science at the Open University of Catalonia.
The big question is what will be the scope of these talks, since the two parties have sharply opposing views over the independence issue.
Separatists want to discuss the possibility of holding a legally binding referendum in Catalonia, as well as an amnesty for their leaders who were sentenced in October to lengthy jail terms over a failed 2017 independence bid.
But the Socialists have already said that such a referendum would be impossible.
The agreement between the Socialists and the ERC calls for an “open dialogue of all proposals” but stresses that the results of the talks must respect the “legal and democratic order”.
“A self-determination referendum in Catalonia is not possible according to the Spanish constitution,” said constitutional law professor Xavier Arbos.
Reforming the constitution to allow a region to hold a self-determination would require the support of a qualified majority in parliament, which looks unlikely since Spain's major parties, including the Socialists, are opposed.
What will most likely happen is that the talks will end in “an agreement to clarify and set in stone what are the region's powers, which would create a special position for Catalonia” within Spain, said historian Joan Esculies.
The wealthy northeastern region, which has its own distinct language and culture, already enjoys significant powers over health and education, and has its own police force.
But a significant part of the population of around 7.5 million people wants even more powers to protect the language and culture, and complains of a lack of investment by the central government in the region.
Catalans are divided over independence, with 47.9 percent against and 43.7 percent in favour, according to a recent poll by the regional government.
Catalonia was rocked by protests which sometimes turned violent last year over the conviction of Catalan leaders, and against that backdrop any concession by Sanchez's government would be fiercely attacked by conservatives.
The main opposition Popular Party and far-right Vox already accuse Sanchez of “treason” for having been sworn in for another term thanks to the abstention of the ERC.
An agreement which gives the region more powers would undoubtably be challenged in the courts by these parties just as the PP did in 2006 against a new autonomy statute for Catalonia.
Spain's Constitutional Court in 2010 struck down several of the statute's articles, causing support for separatism to soar.
“And if that were to be the case, it would cause similar frustration,” said Arbos.
The talks are also opposed by Catalonia's other main separatist party, the more hardline Together for Catalonia of former Catalan president Carles Puigdemont who was in power during the failed 2017 independence bid.
This negotiation “is a long process which will go through phases of reconciliation, estrangement or even rupture. But at least it is a first step,” said Esculies.