President Francois Hollande has named Interior Minister Manuel Valls as France’s next prime minister.
Mr Hollande, whose popularity has slumped, said Mr Valls would head a “fighting government”.
The ruling Socialists have been badly bruised in local elections which saw big gains for conservatives and the far-right National Front (FN).
Mr Valls, 51, has replaced PM Jean-Marc Ayrault, whose office confirmed his resignation on Monday.
In a short televised address on Monday, President Hollande said France had to put right its public finances, acknowledging it was time for change.
He proposed a reduction in taxes and worker contributions to spur job creation. “We are in this for the long haul,” he said.
Mr Valls, a liberal, is distrusted by the Socialist party’s left-wing and has presidential ambitions of his own but he is popular with the voters, says the BBC’s Christian Fraser in Paris.
The second round of municipal elections on Sunday saw the Socialists lose more than 150 towns and cities of more than 9,000 inhabitants. Results are still being counted.
The FN won control of 11 towns, mainly in the south.
The main centre-right opposition, the UMP, was said to have captured a number of key cities, including Toulouse, Quimper, Limoges and Saint-Etienne.
UMP leader Jean-Francois Cope hailed what he called a “blue wave” of support for his party.
The Socialists have been hit by growing discontent over the economy after struggling to keep unemployment figures down and boost economic growth.
Prior to his resignation, Mr Ayrault acknowledged that many voters had lost confidence in his administration.
“This message is clear. The president will draw conclusions, and he will do so in the interest of France,” he added, in an apparent reference to a likely cabinet reshuffle.
Among the victories being celebrated by Marine Le Pen’s National Front was the capture of the 7th district of Marseille, France’s second largest city. The district has a population of about 150,000, which makes it the party’s biggest win.
The Socialists did retain control of Paris, with their candidate Anne Hidalgo due to become the capital’s first female mayor.