Manuel Valls announces presidential run just days after President Hollande, also a Socialist, said he would not run.

French Prime Minister Manuel Valls has resigned after announcing his candidacy for the Socialist nomination in next year’s presidential election.

Stepping down on Tuesday after serving as prime minister for the past two-and-a-half years, Valls said he would now try to rally the fractured left in the run-up to the party’s primary in January.

Interior Minister Bernard Cazeneuve was named as his successor for the six months until the next legislative elections.

Cazeneuve has overseen the French government’s response to recent attacks in France claimed by the Islamic State of Iraq and the Levant (ISIL) group.

The government’s crackdown, under the special “state of emergency” status, has met harsh criticism from rights groups and the country’s Muslim population.

READ MORE: France and the impossible Trump domino effect

Valls’ announcement on Monday came four days after President Francois Hollande announced he would bow out after a single term, paving the way for Valls to try to become the left’s new standard bearer.

In his speech, the 54-year-old vowed to take the fight to the conservative opposition and the far-right National Front, both of whom are leading the Socialists in election polls.

“My candidacy is one of reconciliation,” Valls, seen as a divisive figure, said in a speech from his political base in the Paris suburb of Evry.

He warned of the risk of far-right leader Marine Le Pen pulling off a repeat of France’s 2002 electoral upset when her father, Jean-Marie Le Pen, edged the Socialist candidate for a place in the presidential runoff.

Le Pen’s nationalist policies would “ruin the working class”, he said.

Polls show Marine Le Pen winning or being placed second in the opening round of the election on April 23, but later being defeated by the conservative Francois Fillon.

Valls attacked the Thatcherite, Fillon, accusing him of rehashing “the old recipes of the 1980s” by promising to cut spending and social programmes.

“We’re told that Francois Fillon is the next president of the Republic. Nothing is set in stone,” he said defiantly.

Divided Socialists

Valls faces an uphill task to unite the divided French left, reeling after four tumultuous years under Hollande.

The prime minister himself is a polarising figure who has turned off many lifelong Socialists by using decrees to force contested labour reforms through parliament, and endorsing controversial bans last summer on the so-called “burkini” swimsuit.

His government’s bleak economic record could also clip his wings.

On Monday, he said he wanted to help the working class “regain its dignity” in the face of globalisation.

He faces a challenge from at least seven other candidates in the two-round primary on January 22 and 29.

Martine Aubry, a veteran Socialist and the mayor of the northern city of Lille, said on Monday it was “not a given” that she would back him.

Polls show Valls nonetheless winning the nomination, but trailing in the presidential race, dragged down by competition on the left from business-friendly former economy minister Emmanuel Macron, an independent, and the hard-left Jean-Luc Melenchon of the Left Party.

When Valls last sought the Socialist nomination five years ago, he garnered only 5.6 percent.

He went on to become a spokesman for Hollande’s campaign and was later rewarded with the interior portfolio.

In 2014, he was promoted to prime minister with a mandate to rein in a group of unruly ministers who were undermining Hollande’s authority.

Within months he had a rival for the title of reformer-in-chief in the telegenic banker-turned-economy minister Macron, a protege of Hollande.

In August, Macron walked out on his boss to further his own leadership ambitions while Valls remained by Hollande’s side.