By Catherine Bremer and Sophie Louet

PARIS (Reuters) - Rightist Jean-Francois Cope, an ally of former President Nicolas Sarkozy, claimed the leadership of France's main conservative party on Monday in a closely fought two-way contest marred by mutual accusations of voter fraud.

Cope, already the incumbent leader of the UMP party, beat centrist former prime minister Francois Fillon by 50.03 percent to 49.97 percent, the head of an internal voting commission said - a margin of just 98 votes out of almost 175,000 cast.

The victory could pave the way for Cope, whose controversial campaign included accusations that "anti-white" racism was rife in France, either to run for president himself in 2017 or stand aside for Sarkozy if his mentor chooses to re-enter politics.

"My hands and my arms are wide open," Cope told supporters at party headquarters in Paris after the result was announced.

"It is in that state of mind that I telephoned Francois Fillon this evening, it is in that state of mind that I asked him to join me."

Fillon, speaking at his campaign headquarters shortly after Cope's victory speech, denounced ballot booth irregularities and warned of a deepening split in the center-right group.

"What strikes me is the rift at the heart of our political camp, a political and moral fracture," Fillon said in a brief speech, adding that he had chosen not to dispute the result.

The race descended into chaos earlier as both contenders alleged fraud in a vote that highlighted a deep split between rightists and centrists since the party lost power in May.

The bickering wrecked a contest designed to give the right a fresh start after it lost its 17-year hold on the presidency in May, and prompted political commentators to warn that the UMP could collapse.

The opposition infighting has provided respite for President Francois Hollande, who faced fresh woes on Monday as ratings agency Moody's announced that it was downgrading French debt by one notch to Aa1 from triple-A.

The contest would normally decide the UMP's candidate for the 2017 presidential election, but surveys indicate that two-thirds of party members think Sarkozy has a better chance of wresting power back from the ruling Socialists.

The election row has further fuelled speculation of a comeback by Sarkozy, who has told aides he will feel obliged to return if the Socialists fail to revive the sickly economy.

Alain Juppe, a former foreign minister and a key figure in founding the UMP, condemned what he called "a contest of egos" that he said threatened the party's very existence.

FUTURE DIRECTION

The UMP, founded by former conservative president Jacques Chirac in 2002 to merge various center-right parties including his own Rally for the Republic (RPR), is reeling from the loss of the presidency, parliament and most French regions.

The vote to pick a successor to Sarkozy was meant to determine whether the UMP would cleave to the center ground under Fillon, in keeping with the party's decades-old roots, or move right under the combative Copé in a quest to regain power.

Instead, the disarray could bolster far-right and centrist parties, analysts said.

Cope, 48, said late on Sunday that he had won the race, only to have Fillon announce that was ahead in the vote counts and his camp complain of "massive fraud" at voting stations in areas loyal to Cope.

The Conservative daily Le Figaro talked on its front page of an open crisis at the UMP, and the political weekly L'Express said even Sarkozy could struggle to unite and lead a party torn by divisions and infighting.

Fillon, an urbane former lawyer, has targeted those center-ground voters who abandoned Sarkozy to support Hollande in the May election, put off by Sarkozy's aggressive manner and hardline stance on issues such as immigration.

(Additional reporting by Brian Love and Sophie Louet; Editing by Jon Boyle and Mark John)