Former French president Nicolas Sarkozy lost his bid Thursday to throw out an inquiry into claims he used Libyan cash for his 2007 presidential campaign, a ruling that could require him and several associates to stand trial.

A Paris appeals court upheld the validity of the investigation, launched in 2012 after reports that Sarkozy accepted millions of euros from the regime of former strongman Moamer Kadhafi.

Sarkozy, 65, has denied the allegations. His lawyer declined to comment after the hearing on whether he would appeal the decision to France's top criminal court.

But the failed legal challenge means the inquiry by two anti-corruption judges can continue, though it remains uncertain if they will eventually seek a trial.

Sarkozy has been accused by former members of Kadhafi's regime that he took millions from the slain Libyan dictator, some of it delivered in cash-stuffed suitcases, in his successful 2007 presidential run.

The investigation began after the Mediapart published a document in 2012, allegedly signed by Libya's intelligence chief, purporting to show that Kadhafi agreed to give Sarkozy up to 50 million euros ($58 million at current exchange rates).

Judges are also investigating claims by a French-Lebanese businessman, Ziad Takieddine, who said he delivered suitcases carrying a total of five million euros from the Libyan regime to Sarkozy's chief of staff in 2006 and 2007.

Also charged in the case is Alexandre Djouhri, a businessman known to be close with several top rightwing politicians, who is suspected of acting as a middleman for the cash transfers.

The former president was charged in 2018 with taking bribes, concealing the embezzlement of Libyan public funds and illegal campaign financing.

Two of his former ministers, Claude Gueant and Eric Woerth, are among several others who have also been charged in the case.

Nicolas Sarkozy is accused of taking millions of euros from former Libyan dictator Moamer Kadhafi to help finance his 2007 presidential campaign
Nicolas Sarkozy is accused of taking millions of euros from former Libyan dictator Moamer Kadhafi to help finance his 2007 presidential campaign POOL / ludovic MARIN

"I think the judges proved they were able to resist all sorts of pressure being put on them," said Vincent Brengarth, a lawyer for the Sherpa anti-corruption NGO, one of the civil parties in the case.

The allegations that Sarkozy took money from Kadhafi -- whom he welcomed to Paris with pomp and ceremony shortly after his election victory -- are the most serious to emerge from several investigations that have dogged him since he left office.

The claims first emerged in 2011, as France and Britain were preparing a NATO-backed intervention to support rebels seeking to end Kadhafi's tyrannical 41-year rule.

Besides the claims of cash-stuffed suitcases, investigators suspect that Sarkozy's campaign got cash from the 2009 sale of a villa on the French Riviera to a Libyan investment fund managed by Bashir Saleh, Kadhafi's former chief of staff.

Djouhri is suspected of being the owner of the villa, which was sold at an inflated price to mask the alleged funds from Libya.

It is not the only legal headache for Sarkozy, who has enjoyed renewed popularity since retiring, with his memoirs seeing strong sales.

He has also been charged in two other cases, one relating to fake invoices devised to mask overspending on his failed 2012 re-election campaign, and another for alleged influence peddling involving a top judge.

He is set to go on trial in the second case on October 5, when he will become France's first ex-president in the dock for corruption.

Sarkozy, who quit politics after a failed comeback attempt for the 2017 presidential vote, has accused the Paris judiciary of hounding him.