French Leftwing outsider Benoit Hamon will fight former prime minister Manuel Valls for the French Socialist presidential nomination next Sunday after winning the first round of the party's primary.
Hamon was not considered a serious contender when the campaign began in December but the 49-year-old former education minister put himself in the driving seat with what he called a "message of hope and renewal".
With Europe shifting to the right and the deeply unpopular President Francois Hollande ruling himself out, the Socialist primary has been billed as a fight for the party's soul with a left-leaning faction represented by Hamon battling Valls' centrist camp.
Hamon, 49, scored over 36 percent with Valls trailing on 31 percent, according to results from around 80 percent of polling stations.
Maverick former economy minister Arnaud Montebourg was eliminated with 17 percent and immediately threw his support behind Hamon.
Whoever wins the Socialist nomination faces long odds as polls currently show the presidential election coming down to a contest between conservative ex-premier Francois Fillon, far-right leader Marine Le Pen and Emmanuel Macron, the 39-year-old former economy minister, AFP reported.
A defiant Valls, 54, told his supporters the Socialist primary runoff would be "a clear choice between unachievable promises and a credible left".
Hamon said he offered hope to a party ailing after five years under Hollande beset by economic sluggishness and mass protests.
His supporters had voted "through conviction and not out of resignation", he said.
Hamon performed strongly in three TV debates crammed into a short campaign, attracting attention with a proposal to give the unemployed and low-paid a "universal income" rising from 600 euros to 750 euros ($640 to $800) a month. Valls has poured scorn on the idea.
The two men will face off in a head-to-head TV debate on Wednesday.
The photogenic Macron has stolen the limelight from his former Socialist government colleagues in recent weeks, with his campaign speeches packed to overflowing.
But with right-wing ideas taking root across Europe, most opinion polls currently show a Fillon-Le Pen presidential showdown as the most likely scenario in May.
Macron is projected to score better than the Socialist candidate in the first round but both would be knocked out.
Valls, who was slapped by a protester during campaigning, appears to have paid the price for his association with Hollande and has at times struggled in a contest he had been expected to dominate.
Following his elimination, Montebourg backed his former cabinet colleague Hamon, both of whom represent the Socialists' left flank.
"We left the government together, we fought together. Next Sunday I'll be voting Hamon," he said.
Some Socialist supporters said Hamon was a breath of fresh air.
"To me he is the one best placed to revive the party," said Jean-Claude, who cast his ballot in Millau, southwestern France.