French Prime Minister Edouard Philippe has tendered his resignation after heading President Emmanuel Macron's government for three years.
The president swiftly named centre-right mayor Jean Castex to lead a new team of ministers after a reshuffle.
Although Mr Philippe was considered more popular than the president, the ruling party had poor local election results at the weekend.
President Macron promised a "new path" in an interview published on Friday.
Mr Philippe met the president early in the morning and they agreed the government would resign.
A reshuffle has been expected for some time, and it is common practice for a French president to replace a prime minister during the five-year term in office known as the "quinquennat".
The Elysée palace said in a statement that Mr Philippe had "today handed in the government's resignation to the president of the republic, who accepted it", adding that he would stay in place until a new government was appointed.
Hours after Mr Philippe's resignation, it was announced that the Law Court of the Republic, which deals with claims of ministerial misconduct, would open an inquiry into the way his government handled the pandemic.
Along with the outgoing prime minister, those under investigation include Agnès Buzyn, who stepped down as health minister in February, and her successor Olivier Véran, senior public prosecutor François Molin said.
France has reported 202,673 confirmed cases of Covid-19 and 29,875 deaths.
Who is Jean Castex?
Mr Castex, 55, is little known in France, but he is a senior civil servant and has played a key role in the government's response to the Covid-19 pandemic.
He has picked up the nickname "Mr Deconfinement", after Mr Philippe chose the Republicans party mayor from Prades in the Pyrenees to co-ordinate France's strategy of lifting the lockdown.
He attended the same elite university as Mr Macron and Mr Philippe and, like Mr Philippe, was previously a member of the right-wing Republicans party.
On Friday evening, Mr Castex warned in a speech that "the health crisis is, unfortunately, not over" and that "the economic and social crisis is already here".
"Priorities will therefore have to evolve, ways of working will have to be adapted. We will have to unite the nation to fight this crisis that is setting in," he added.
Why Macron is changing his team
Mr Macron came to power three years ago but now faces an economic crisis after the coronavirus pandemic.
In the interview with regional newspapers, he spoke of a "very tough" recovery for France, and focused on the immediate priority of saving jobs, as well as economic, social and environmental reconstruction.
Mr Philippe's future as prime minister had been in doubt for several weeks and he will now take up the post of mayor in Le Havre, after winning the local vote on Sunday.
A removal van and cardboard boxes were seen arriving at his Matignon residence on Friday indicating he was preparing to move out.
Why Macron faces difficult choice
Amid the chaos of coronavirus, President Macron talked of "reinvention" and a "new path". Few here doubted that it would mean a new government.
Edouard Philippe was a good fit for Mr Macron during this crisis: a technocrat from the centre right who was seen as a steady pair of hands during the coronavirus epidemic, but he had started to outshine the president - a dangerous place to be at any time, let alone a time that calls for change.
Mr Macron is facing a complex set of demands. On one hand, he wants to "reinvent" himself for the last two years of his mandate, and has been projecting a softer version of himself; more open to listening and admitting mistakes, more focused on green issues and social justice.
On the other hand, centre-right votes are likely to be key to any re-election bid and, after several years of pushing hard for his liberal economic reforms, a blatant change of tack at this stage could look less like reinvention and more like confusion.
Having already promised massive investment in France's health service, committed to pursuing pension reforms - at least in some form, and facing the worst recession in France since World War Two, Mr Macron needs someone he can rely on, someone who can take the flak if needed.
That's what prime ministers are meant to do. Edouard Philippe broke the rules. As he heads towards the next presidential race, Mr Macron won't want to be outshone again.
"For three years he's been by my side... we've carried out important, historic reform often in very difficult circumstances. We have a relationship of trust that's in a way unique in terms of the French Republic," the president said of Mr Philippe in his newspaper interview.
Under France's constitution, the prime minister is appointed by the president to run the government and co-ordinate its actions under policies set out by the head of state.
The new prime minister may be relatively unknown but he has plenty of experience in national government. Seen as a social conservative in the Republicans party, he was part of President Nicolas Sarkozy's team at the Elysée palace and served as deputy to the health minister.
Why France is looking for change
Mr Macron's young LREM party has struggled to maintain the initial support it won from voters after his presidential victory in 2017. Dogged by ministerial resignations, it has also seen a number of defections in the National Assembly, losing its outright majority in May.
The party failed to win any major city in Sunday's local elections, in which Green candidates and their left-wing allies made significant gains.
An opinion poll for Le Figaro and France Info on Thursday suggested three quarters of French voters were looking for political change from the president.
Although many of those surveyed wanted greater focus on social and environmental change, 59% were happy for Mr Philippe to stay in his job.