CHATEAURENARD, France (Reuters) - Nicolas Sarkozy said on Thursday he would impose a nationwide ban on burkinis if elected back to the presidency in 2017, positioning himself as a strong defender of French values and tough on immigration.

Hundreds of supporters waving French flags chanted “Nicolas! Nicolas!” and applauded as Sarkozy, a conservative president from 2007 to 2012 before losing an election to Socialist Francois Hollande, promised to protect the French people.

“I will be the president that re-establishes the authority of the state,” Sarkozy told a crowd of more than 2,000 packing a sports hall in Chateaurenard, a Provence town where his Les Republicains beat the far-right Front National (FN) in regional elections last year.

“I want to be the president who guarantees the safety of France and of every French person,” the 61-year-old said, sending a message that he could tackle the Islamist violence that has killed 230 people in attacks since January 2015.

For months he lagged in opinion polls behind Alain Juppe, a mild-mannered, more centrist former prime minister who is his main rival for the November primaries that will choose a conservative candidate for the election.

But his popularity, which had already started improving with party sympathisers in June, rose after Islamist attacks on a Bastille Day crowd in Nice and on a priest in Normandy.

Taking a hard line on a debate that has agitated France over the past weeks, Sarkozy told supporters in Chateaurenard, his first rally for the 2017 election, that the full-body swimwear known as the burkini should be banned throughout the country.

Slideshow ( 5 images )

Several seaside towns have outlawed it, arguing that it breaks French laws on secularism, but there is no national ban.

“I refuse to let the burkini impose itself in French beaches and swimming pools ... there must be a law to ban it throughout the Republic’s territory,” he said to wide applause.

“Our identity is under threat when we accept an immigration policy that makes no sense,” he said.

Sarkozy is seeking to win back votes from the far-right National Front whose rising popularity mirrors that of populist politicians in other countries that have appealed to voter worries over globalisation and immigration, such as U.S. Republican presidential nominee Donald Trump and the leaders of Britain’s Brexit campaign.

Responding to an accusation by Prime Minister Manuel Valls that his proposals were brutal, Sarkozy said:

“The French people are not fascist because they consider there are security problems ... In my speech there is no fear, there is no hatred, there is just common sense.”

While some in the hall said they came out of curiosity, staunch supporters said they had voted twice for him already and would do so again in the late April and early May 2017 election.

“We came here to support him, we’ll vote for him because he is dynamic and he has proven during the subprime crisis that he is serious and up to the job,” said 77-year-old pensioner Georges Petit, who came to the rally with his wife.