Gerard Collomb, who had been seen as one of Macron's most robust defenders, had indicated two weeks ago that he intended to step down next year, but he came under increasing pressure and made an initial attempt to resign Monday, only to be rebuffed by the president.
In an announcement early Wednesday the Elysee confirmed that Macron had accepted a fresh bid to quit from Collomb.
The president has "accepted the resignation of Gerard Collomb and asked the prime minister to act in his place until the announcement of a successor", it
said in a statement.
Collomb, a political heavyweight, had previously announced that he planned to run for his old job as mayor of the city of Lyon.
He said he would stay on as minister until European elections in May, but came under pressure to step down immediately as critics complained that his priorities had already turned to the campaign trail.
Late Monday, Macron's office said the president had vetoed his resignation attempt, insisting on "his confidence" in the 71-year-old.
But Collomb on Tuesday had said he still intended to quit, throwing the French political establishment into confusion.
"Gerard Collomb has resigned again. How long is this sketch going to last?" tweeted far-right leader Marine Le Pen Tuesday.
Prime Minister Edouard Philippe cancelled a trip to South Africa planned for Thursday and Friday after being asked to step in, his office said.
Under the French constitution, the president names and removes ministers upon instructions from the premier.
Collomb has previously compared his relationship with Macron, 31 years his junior, to that of a father and son. He wept during Macron's inauguration in May 2017.