PARIS — He was beaten in the last presidential election, his presidential term was considered a failure, and he has been the subject of numerous judicial inquiries. In most other political systems, he would be a has-been. Yet in a France under terrorist threat, Nicolas Sarkozy may be the man of the moment in a presidential race picking up steam.

By hammering on the idea that France’s “identity” is being challenged at a moment of deep unease over terrorism, the mercurial Mr. Sarkozy may be on to something with the electorate. This past week, his new book put “identity” front and center in his new campaign. It quickly climbed to the top of a popular best-seller list, outpacing even the season’s novels.

As is typical with such instant books, Mr. Sarkozy used his hastily written extended pamphlet to announce his candidacy. He will run in his right-of-center party’s November primary, he said. And he is consistently strong in polls.

At a rally in a sweltering auditorium in France’s south late last month, his first of the campaign, Mr. Sarkozy got his loudest cheers when he conflated the fight against terrorism with the fight for France’s identity.