PARIS (Reuters) - Nicolas Sarkozy will run for president in 2017, hoping to return as France's head of state after being unseated in 2012 by the now deeply unpopular Francois Hollande, he announced on Monday.

A figure either loved or loathed by conservative voters, Sarkozy says in a forthcoming book he will join more than a dozen contenders vying for the party ticket in primaries, where former prime minister Alain Juppe will be his strongest rival.

"I felt I had the strength to lead this battle at a troubled time in our history," Sarkozy wrote on his social media pages ahead of the publication on Wednesday of "Everything for France".

Sarkozy has done little to conceal his desire to return to the Elysee Palace since returning to high-level politics in late 2014 when he took the helm of France's main center-right party, Les Republicains.

In July his poll rating overtook Juppe's among core Les Republicains supporters, though he was still less popular among center-right voters as a whole.

With a string of deadly Islamist attacks shaping the political discourse, Sarkozy has been scathing of Hollande's security record, urging France to get tough on immigration, crack down on Islamist militancy and halt the erosion of France's secular identity.

Courting voters tempted by France's far-right National Front, Sarkozy has laced speeches with references to national identity and blamed "cowardly leaders" for a loss of French culture.

"It wasn't that long ago that when we talked about immigration, identity and removing citizenship we were called fascists," Sarkozy told supporters in June.

"But minds have changed, the masses are rising, the people are standing up and they are saying louder and louder: 'That's enough!'"

With France in a state of emergency, Sarkozy's emphasis on national identity and the credentials to present himself as a former interior minister and experienced Commander-in-Chief may help his chances.

But legal troubles surrounding party financing and over-spending by his 2012 presidential campaign, as well as his divisive personality could trip him up.

Sarkozy credits himself with steering Europe through the financial crisis during his 2007-2012 term. But his weak performance on free-market reforms to revive the economy disappointed business leaders.

The Nov. 20 primary is the first ever to be held by France's main right-wing party. If, as expected, no candidate, wins an absolute majority a run-off vote will be held a week later.

FRACTURED SOCIALISTS

Sarkozy's announcement comes as the list of candidates to replace Hollande grows and fractures between the Socialists are getting deeper just eight months before the presidential poll.

Government spokesman Stephane Le Foll urged leftist lawmakers on Monday not to place personal ambitions before the party after former industry minister Arnaud Montebourg threw his hat into the ring, saying it was "impossible to support the current president" who had betrayed socialist values.

Montebourg split with Hollande's government in 2014 over his shift in favor of market-friendly reforms. So did former education minister Benoit Hamon and former housing minister Cecile Duflot, a Green, both of whom are also running.

The simmering rebellion has already forced Hollande to allow an unprecedented primary contest to select the party's candidate.

But the increasingly crowded field complicates his re-election prospects should he chose to run for a second term.

A large pool of candidates, ranging from the communists to center-left, would further dilute Hollande's support base.

Most polls show that if Hollande does run as the left's candidate, he will come third to far-right Front National leader Marine Le Pen and whoever heads the main center-right campaign.

Splits in the main parties is a gift to the National Front which hopes to convince voters it alone can offer a new form of leadership.

"Montebourg, Duflot, Sarkozy: Why are all those who have governed and failed recently coming back? Do they hope that we have forgotten?," the party's vice-president Florian Philippot said on Twitter.