Valls, who was PM under former President François Hollande told French radio on Tuesday morning that he was walking away from the Socialist party.
“Part of my political life is coming to an end. I am leaving the Socialist Party, or the Socialist Party is leaving me,” the 54-year-old told RTL radio.
Valls, who was prime minister under Socialist president Francois Hollande from 2014 to 2016, was rejected by Socialist voters in the party's primary to choose a candidate for this year's presidential election.
The party chose hard-left candidate Benoit Hamon instead and he failed to reach the run-off of the presidential election in May as France's two main parties fell at the first hurdle for the first time since 1958.
Earlier this month Valls was re-elected as an MP in the department of Essonne by a tiny majority.
Shortly after his announcement the majority Republique en Marche (REM) party announced that MPs had voted to allow Valls to sit among their ranks in the new parliament, which sits for the first time on Tuesday.
Macron's party won a huge majority in June's parliamentary elections, while the Socialist party only picked up 30 seats.
However Valls will not officially be joining the REM party, but he will benefit from certain logistical advantages of being part of the majority such as having access to speaking time in parliament.
The former PM had suffered humiliation last month when he announced he wanted to join Macron's party, only to be told to join the back of the queue like everyone else.
At the time the secretary general of Macron's La République en Marche (Republic on the Move), Richard Ferrand said Valls “did not meet the criteria” of Macron's desire to renew French politics.
In the end a deal was reached and REM decided not to put up a candidate to stand against Valls in his constituency.
The pugnacious, Spanish-born Valls was Macron's boss when the now-president was economy minister and a fierce rivalry developed between them.