IT WAS a decisive victory, but not a crushing one. On November 29th Nicolas Sarkozy (pictured), the former French president, was elected leader of the centre-right UMP party with 65% of the vote. This puts the party machinery firmly in his grip, as it was in 2004, when he was first elected UMP leader as a prelude to his 2007 presidential bid. But unlike in 2004, when he secured 85% of the vote, Mr Sarkozy is this time a more contested leader. His path to the 2017 presidency will be more perilous.

In a message posted on his Facebook page after results came through, Mr Sarkozy called his election a “new start” for the party, and urged the centre-right to unite behind him. A sense of unity has eluded the UMP ever since Mr Sarkozy lost his presidential re-election bid in 2012 to François Hollande and vowed to withdraw from public life. The party has spent most of the time since then fighting internally, leaving the opposition to Mr Hollande open to the populist National Front. The National Front placed first in the European Parliament's elections in May; its leader, Marine Le Pen, was re-elected party boss on November 30th with a Soviet-style 100% of the vote.

In a television interview the day after his election, Mr Sarkozy insisted that he would be as inclusive as possible. He said that he would reach out to the political centre as well as the right, and would set up a committee of former UMP prime ministers as a sort of group of wise men within the party. These would include, he said, Dominique de Villepin, himself once a bitter rival to Mr Sarkozy. He has also said that he wants to change the party’s name, and organisation, to give it a fresh impetus.

But Mr Sarkozy’s ambition to rally the party behind him is likely to be a lot tougher than he might have liked. His closest opponent in the UMP leadership election, Bruno Le Maire, secured fully 29% of the vote, a result that far exceeded his team’s expectations. This may give Mr Le Maire, a former minister under Mr Sarkozy and Mr de Villepin’s one-time chief of staff, a boost for his own future ambitions.

More importantly, Mr Le Maire’s score reflects the fact that he drew votes from UMP members dissatisfied with Mr Sarkozy. They would prefer to see the party elect as its 2017 presidential nominee one of his two rivals, Alain Juppé or François Fillon, both former prime ministers. Neither of them will want to make Mr Sarkozy’s job easy. “Unity”, said Mr Fillon scathingly after the UMP leadership result came through, “does not mean submission.”

Besides differences over mere issues such as economic policy or immigration, one of the most fiercely contested matters over the coming months will be deciding on the rules for the party presidential primary. For the outcome will depend in large part on the way the UMP holds this vote. If the primary is a vote by card-carrying members only, who tend to be more right-wing than UMP voters as a whole, Mr Sarkozy will be the favourite. This weekend’s result testified to Mr Sarkozy's strength among party members, as did a recent Ifop poll, which gave Mr Sarkozy 52% of UMP voters, next to 33% for Mr Juppé and 7% for Mr Fillon.

If the UMP opens its primary to non-party members, however, as the Socialists did in 2011 (drawing over 2.6m voters), then the result could be much closer. Both Mr Juppé and Mr Fillon are soft-right candidates who appeal to centrist voters, and they will argue forcefully for a wider vote. The same Ifop poll in November, taken before the UMP leadership ballot, made Mr Juppé the favourite among French voters as a whole, centrists and leftists included. Mr Juppé took 36%, next to 21% for Mr Sarkozy and 6% for Mr Fillon. In other words, Mr Sarkozy is now back in politics and on the airwaves, and may have his hands on the party. But the battle for the presidential primary has only just begun.