Valls' announcement Tuesday that he wanted to run for parliament with Macron's party received a frosty reception from Macron's team.
Valls' announcement Tuesday that he wanted to run for parliament with Macron's party, La Republique en Marche (LREM), received a frosty reception from Macron's team, pointing to lingering tensions between the two political heavyweights.
On Thursday, LREM confirmed his candidacy had been turned down but said it would stay out of competition in Valls' district.
"You don't slam the door in the face of a former prime minister," said LREM secretary general Richard Ferrand.
Ahead of Thursday's compromise announcement, a Socialist official predicted that the pugnacious Spanish-born Valls, 54, would serve as a "sacrificial lamb" for Macron, 39, in a bid to "kill off the Socialists".
Valls, thought to be disliked by many LREM insiders, had taken a gamble by saying he wanted to run on Macron's ticket, apparently without seeking private assurances that he would be selected.
The former prime minister was curtly told to apply online like everyone else, and reportedly faced the further humiliation of being unable to navigate the website.
"I don't understand. I'm clicking and clicking on your site but it's not working," Valls was reported to have told nomination chief Jean-Paul Delevoye.
Valls, who saw his presidential ambitions dashed in the Socialists' January primary, had ironically found his political fate in the hands of the man to whom he provided a presidential launchpad by making him economy minister in 2014.
Just weeks earlier, Macron, then just 36, had left his advisory role in the president's office with plans to create a business or even teach abroad.
While both Valls and Macron embodied President Francois Hollande's shift to neo-liberal policies, an enduring rivalry developed between the pair.
"Their positions are basically very close economically and ideologically, but there's personal baggage," said political analyst Stephane Rozes.
Valls was openly critical of Macron a year ago when the younger man launched his own independent movement, then named simply En Marche ("On the Move").
Then when Macron quit the government to launch his presidential bid, Valls was categorical: "I have a principle, and that's loyalty, loyalty to the president, of course, but not only; loyalty to the French people... you cannot desert."
In a documentary that aired this week on French TV, Macron charged that Valls' jockeying for position ahead of his presidential bid was a far worse betrayal of Hollande.
"If there's a traitor, someone who killed Hollande, it's Valls," Macron said.
In the end, the LREM had a clear criterion that ruled out Valls: candidates cannot have served three or more terms in parliament.
Valls is the outgoing Socialist MP from a constituency south of Paris where he has been re-elected twice.
A process has begun to expel Valls from the party, which is in any case in the grips of a dire battle for relevancy.
After the deeply unpopular Hollande opted out of running for re-election, its candidate Benoit Hamon barely topped six percent in the April 23 first round.
Hamon plans to launch a new leftwing movement.