His resignation, which he announced to a gathering in Madrid of the roughly 300 members of the party's federal committee, could see the party lift its veto on a new government led by acting conservative Prime Minister Mariano Rajoy.
Since December 2015, the country has been without a fully-functioning executive as rivals have failed to agree on a government following two elections in which none of the main parties won an absolute majority.
His detractors want the party to use the 85 parliamentary seats it won in June polls to help unblock the national deadlock and allow Rajoy to lead a right-wing government by abstaining in a vote of confidence, rather than voting against as it did earlier this month.
Supporters of Sanchez however believe it would have been preferable to stop Rajoy from ruling again, even if it meant prolonging the deadlock.
More From This Section
Even Rajoy, whose Popular Party (PP) won both elections though without enough seats to rule alone, was forced into negotiating a minority government which was voted down in parliament earlier this month.
The PSOE has been wracked for months by internal dissent, and the ill-feeling was evident again Saturday as Sanchez supporters shouted "no means no, no means no."
Dozens of Sanchez backers roundly booed his opponents at the party's headquarters, decrying them as "putschists" and "fascists" as they gathered for the meeting.
His opponents however want an end to the political paralysis that has wracked the nation for nine months.
The PSOE's place is "in the opposition," said Socialist lawmaker Eduardo Madina, who opposes Sanchez.
Sanchez opposes another Rajoy term, pointing to repeated corruption scandals hitting the PP and inequalities sparked by years of austerity.