For months, the 44-year-old had been resisting overtures by acting conservative Prime Minister Mariano Rajoy to enter a coalition or let his minority government rule, as Spain was knee deep in political paralysis following two inconclusive elections.
But in the end, it was his own party that precipitated his downfall, with high-ranking members voting against his strategy Saturday after a bitter internal rebellion, arguing it was best to let a Rajoy-led government through rather than go to third elections.
Sanchez resigned on the spot.
The former economics professor was largely unknown when he took the reins of the Socialist party (PSOE) in July 2014 after winning the first ever primary elections organised by the 137-year-old grouping.
Always immaculately suited and booted, tall and with Hollywood good looks, the married father-of-two had pledged to revamp a party struggling to recover from former Socialist prime minister Jose Luis Rodriguez Zapatero's management of the economic crisis.
'No is no'
Born in 1972 in Madrid, Sanchez grew up in a wealthy family – his father an entrepreneur and his mother a lawyer.
He studied in the Spanish capital before getting a Master's degree in political economy at the Universite libre de Bruxelles in Belgium.
Politics, though, were always his passion.
He was an opposition town councillor in Madrid from 2004 to 2009, after which he entered parliament as a lawmaker under Zapatero's administration.
That ended when the conservative Popular Party (PP) swept to power in 2011 with an absolute majority, kicking the struggling Socialists out of power.
But he returned to the lower house in 2013 after the resignation of a lawmaker, and then went on to be voted in as Socialist party chief.
In public, he likes to cultivate the image of a good family man with his wife Begona, a dazzling smile always at the ready.
But he has also shown an aggressive side — particularly where Rajoy is concerned, his “bete noire.”
This came to the fore in a televised debate with Rajoy last year before December polls.
“The head of the government, Mr Rajoy, has to be a decent person, and you are not,” he said, demanding to know why he had not resigned over repeated corruption scandals that had hit the PP.
And after two inconclusive elections in December and again in June, Sanchez steadfastly refused to back any coalition government led by Rajoy.
“No is no,” he famously said, as the acting prime minister tried to approach him for a government deal.
On top of the corruption scandals, he accuses Rajoy of having deepened inequalities in Spain through severe austerity measures.
Instead, he has rooted for an “alternative” government, turning unsuccessfully to centre-right upstart Ciudadanos and far-left Podemos to form a government.
A source close to Sanchez says he is actually wary of Podemos, a party that has made no secret of wanting to replace it as Spain's main left-wing force, and with whose leader Pablo Iglesias “he has never got along.”
Bad to worse results
But as the PSOE went from bad result to worse result – first in December elections, then in a June vote and finally in two regional polls last weekend – high-ranking members of the PSOE decided to rebel.
Sanchez has been criticised for keeping key party members in the dark about what was happening.
Thought to trust only a few close allies, he even ignored advice from former prime minister Felipe Gonzalez – a Socialist heavyweight – who then came out publicly against him.
Even the leading left-wing El Pais daily has rallied against him.
“Sanchez has ended up not being a fine leader, but an unscrupulous fool who doesn't hesitate in destroying the party he has so mistakenly led rather than recognise his huge failure,” it wrote Thursday.
But Ignacio Escolar, founder of the left-wing online daily eldiario.es, rejected this.
“If Pedro Sanchez is really such a terrible, disastrous, pathetic leader as portrayed by those who once supported him, why don't they want to confront him in primaries?” he asked.
By Marianne Barriaux, Laurence Boutreux / AFP