Edouard Philippe has for years been close to leading Republican Alain Juppé
Mr Philippe, 46, is not from the president’s new centrist party but from the centre-right Republicans.
The choice is seen as an attempt to draw in key figures from both the right and left of French politics.
The announcement forms part of a busy first day for the president – he is due to meet Chancellor Angela Merkel in Berlin.
The naming of a new prime minister, Mr Macron’s first big appointment, came after hours of fevered speculation in France and a day after he was inaugurated as president.
Already tipped as favourite for the job, Edouard Philippe, mayor of the northern port city of Le Havre, has long been close to Alain Juppé, who was runner-up in the race for the Republican presidential nomination in November 2016.
Who is Edouard Philippe?
For years he has been seen as Alain Juppé’s right-hand man and backed his unsuccessful 2016 bid to secure the centre-right presidential nomination. He quit the Republican campaign when the chosen candidate, François Fillon, was engulfed in a “fake jobs” investigation.
Earlier this year he likened Mr Macron to Brutus’s despatch of Julius Caesar in his treatment of President François Hollande.
Before he became mayor of Le Havre, he worked in the private sector and co-wrote a political thriller with Gilles Boyer, who went on to run the Juppé campaign.
Read more on Edouard Philippe here: Who’s who in Macron’s team?
Does Macron have what it takes to reform France?
What are President Macron’s policies?
Why reaction is mixed
Several weeks ago, Mr Macron tweeted that he was keen on selecting a woman prime minister, and there was some disappointment on social media that he had so far failed to choose a woman for any cabinet role.
In Mr Philippe’s own Republican party, reaction to his appointment was mixed. Alain Juppé praised the new prime minister as a man of “great talent”. Another leading Republican, Bruno Le Maire, welcomed the appointment as an attempt to overcome old political divisions.
But party secretary-general Bernard Accoyer said there was no political agreement between the two parties. “Will this new prime minister support the president’s En Marche candidates… or the candidates of his political family?” he asked.
President Macron faces crucial parliamentary elections next month and may need the support of the centre right to push through his planned economic reforms.
“Divisions have to be overcome” – newly-elected President Emmanuel Macron
His new party, La République en Marche (Republic on the move), announced last week a list of 428 candidates for the June vote, half of whom were women. Only 5% were MPs in the outgoing French parliament – and those MPs were all from the Socialist left.
What will he discuss with Merkel?
The staunchly pro-EU president’s meeting with Chancellor Merkel is eagerly awaited in Berlin.
“The election of the new French president offers us here the possibility to bring dynamism into the development of Europe,” Mrs Merkel said on Monday.
However, she was cautious on his plans for reforming the eurozone.
“There are many proposals which have been on the table for years,” she told reporters. “Of course, I will discuss this with him and I will say let’s be open, so we can achieve things together, not get stuck on what can’t be done.”
A finance ministry spokeswoman was less diplomatic about the chances of progress on eurozone reform, pointing out it would require treaty change “which is at the moment not realistic”.