Asked on French television if he would vote for Macron, 39 and a former economy minister, Valls said: "Yes, because I think you should not take any risks for the Republic. So, I will vote for Emmanuel Macron," who is predicted to face far-right leader Marine Le Pen in the second round run-off.
The endorsement comes as a boost for Macron, who left Valls's Socialist government to form his own political movement that he says is "neither right nor left."
The decision of Valls to endorse Macron will likely be seen with fury by the official Socialist candidate Benoit Hamon, who defeated Valls in a left-wing primary.
The candidates from the traditional left and right of the French political spectrum have seen their campaigns upended by the youthful Macron -- seen as a fresh face in staid French politics -- and Le Pen.
More From This Section
On the right, Francois Fillon from the Les Republicains party has seen his chances founder on a fake jobs scandal. He is facing charges he misused public funds with payments totalling 680,000 euros (USD 739,000) to his Welsh-born wife.
Polls show that Le Pen and Macron are the two most likely candidates to progress to the second-round run-off on May 7, where Macron is predicted to win by about 20 percentage points.
However, given the unpredictable nature of the campaign so far and previous electoral shocks in Britain and the United States, analysts caution against taking anything for granted.