Spain has been stuck in political limbo since July’s general election.
The agreement announced on Tuesday came a day after Sanchez met Sumar leader and acting Labour Minister Yolanda Diaz.
“This governing deal for a four-year legislative term will allow our country to continue growing in a sustainable manner and with quality employment, developing policies based on social and climate justice while broadening rights, feminist conquests and freedoms,” the two parties said in a joint statement.
They added the agreement included plans to reduce youth unemployment, reinforce the public healthcare system, boost public housing, raise emission reduction targets, and a tax reform hitting banks and large energy companies.
Spain held a snap election in July that saw the conservative Popular Party (PP) finishing first but lacking enough votes to form a government.
Last month, PP leader Alberto Nunez Feijoo lost a critical parliamentary vote to become prime minister.
Sanchez’s PSOE party, which came second in the general election, needs the support of Sumar’s 33 lower-house lawmakers and other parties, including those that advocate for Catalan and Basque independence, to renew his term.
In exchange for its support, the Catalan party JxCat is demanding amnesty for politicians and activists facing legal action over their role in Catalonia’s failed 2017 independence bid.
But the proposed amnesty has angered those on the right and some within Sanchez’s party who argue that it jeopardises the rule of law.
If no candidate secures a majority by November 27, a repeat election will be called in January 2024.