Center-leaning Manuel Valls will face more liberal Benoit Hamon in a runoff January 29 when French left-wing voters will choose their candidate to confront conservative and nationalist rivals in the April-May presidential election.
Hamon, a former education minister, won more than 36 percent of the vote, with former prime minister Valls trailing at 31 percent, according to nearly complete results from polling stations.
A defiant Valls, 54, told his supporters the Socialist primary runoff would be "a clear choice between unachievable promises and a credible left."
Hamon, 49, said he offered hope to a party ailing after five years under President Francois Hollande beset by economic sluggishness and mass protests.
With Europe shifting to the right and the deeply unpopular Hollande ruling himself out, the competition is expected to be tough for the Socialist nominee in the race for the two-round presidential election on April 23 and May 7.
The far-right National Front party of Marine Le Pen, running against conservative former prime minister Francois Fillon, and 39-year-old former economy minister Emmanuel Macron, is generally expected to dominate the first round, reflecting a wider populist backlash in Europe and the U.S., where President Donald Trump took office Friday.