NANTERRE, France - French former president Nicolas Sarkozy was told after two days in custody on Wednesday that he is being formally treated as a suspect as magistrates investigate claims his 2007 election campaign got funding from late Libyan leader Muammar Gaddafi.

The move made Sarkozy - who ruled from 2007 to 2012 and is still an influential behind-the-scenes player on the political right - the target of an inquiry into alleged cash handovers and wire transfers between Tripoli and Paris in the months before he won power.

It marked a dramatic acceleration in an inquiry that had largely faded in the news since it was opened five years ago, shortly after the 63-year-old left office.

Sarkozy has now been released from police custody but put under judicial supervision.

In French legal jargon, he was officially "placed under investigation" - a step judicial investigators can take if they have serious grounds for suspecting an offence. Being placed under investigation often but not always leads to trial.

The investigation will now focus on suspected offences that include passive corruption, illegal campaign financing and concealing the misuse of Libyan public funds, an official at the judiciary said on condition of anonymity, the standard way of communicating on such matters in France.

It is the second major investigation for Sarkozy, who also faced charges of illicit campaign spending overruns during his failed re-election bid in 2012.

The latest case concerns accusations by a Franco-Lebanese businessman, Ziad Takieddine, who says he helped funnel 5 million euros ($6 million) from Gaddafi's intelligence chief to Sarkozy's campaign chief ahead of the 2007 election.

Sarkozy himself has not commented publicly since he first answered a police summons for questioning on Tuesday. He has in the past dismissed the allegations as "grotesque" and described them as a "manipulation". The source in the judiciary said he had denied any wrongdoing during questioning.

The inquiry began in 2013, after investigative website Mediapart published Takieddine's allegations. urn:newsml:reuters.com:*:nL8N1R21BX

In an interview with Lebanon's L'Orient du Jour newspaper published on Tuesday, Takieddine said he acted as an intermediary between France and Libya during the time that Sarkozy served as interior minister, before his election bid.

Five months after Sarkozy was elected president, Gaddafi visited him in Paris, on his first state visit to a Western capital in decades. The eccentric Libyan leader pitched a Bedouin-style tent near the Elysee Palace.

Later, Sarkozy became one of the chief advocates of the NATO-led campaign against Gaddafi that resulted in the dictator's overthrow and killing by rebels in 2011.

Sarkozy, once branded a "bling-bling" president because of a penchant for flashy behaviour, has been dogged for years by political scandals, but none has led to a conviction.

He is not the first French president to be questioned by police after leaving office.

After leaving office, his predecessor, Jacques Chirac, was convicted in 2011 of misusing public funds to maintain political friends in phantom jobs - making him the first French head of state to be convicted of a crime since Nazi collaborator Marshall Philippe Petain in 1945.

(Reporting by Simon Carraud, Benoit Tessier and Paris bureau; Writing by Brian Love Editing by Gareth Jones) ((brian.love@thomsonreuters.com; +33 1 4949 5363;))