PARIS (AP) — Former French President Nicolas Sarkozy was handed preliminary charges Wednesday over allegations he accepted millions of euros in illegal campaign funding from the late Libyan leader Moammar Gadhafi.

A judicial official told The Associated Press that investigating judges overseeing the probe gave the ex-president charges of illegally funding his successful 2007 campaign, passive corruption and receiving money from Libyan embezzlement.

The person was not authorized to speak publicly about the case.

The charges involving illegal campaign funding from a foreign dictator are the most serious faced by a former French president in recent history. They were presented after Sarkozy was questioned for two days by anticorruption police at a station in Nanterre, northwest of the French capital.

Investigators are examining allegations that Gadhafi’s regime secretly gave Sarkozy 50 million euros (about $62 million) overall for his presidential election bid.

The sum would be more than double the legal campaign funding limit at the time — 21 million euros. In addition, the alleged payments would violate French rules against foreign financing and requiring that the source of campaign funds be declared.

Sarkozy, 63, who was France’s president during 2007-12, has repeatedly and vehemently denied any wrongdoing. According to the same source, he again proclaimed his innocence during his questioning by police.

The former president was released on Wednesday night, but placed under judicial supervision. Details of the restrictions he has been ordered to obey have not been revealed.

In the French judicial system, preliminary charges mean Sarkozy is personally under formal investigation in a criminal case. The judges will keep investigating the case in the next weeks and months.

At the end of their investigation, they can decide either to drop the preliminary charges or to send Sarkozy to trial on formal charges.

Sarkozy had a complex relationship with Gadhafi. Soon after winning the French presidency, he invited the Libyan leader for a state visit and welcomed him to France with high honors.

But Sarkozy then put France in the forefront of the NATO-led airstrikes against Gadhafi’s troops that helped rebel fighters topple Gadhafi’s regime in 2011.

Sarkozy has faced other campaign-related legal troubles in the past. In February 2017, he was ordered to stand trial after being handed preliminary charges for suspected illegal overspending on his failed 2012 re-election campaign. Sarkozy has appealed the decision.

In 2013, he was cleared of allegations that he illegally took donations from France’s richest woman, L’Oreal heiress Liliane Bettencourt, on the way to his 2007 election victory.

His lawyer, Thierry Herzog, did not respond to requests for comment from The Associated Press.

Sarkozy’s former top aide, the ex-minister Brice Hortefeux, was also questioned Tuesday, but not detained. He said on Twitter that the details he gave investigators “should help put an end to a series of mistakes and lies.”

The investigation got a boost when French-Lebanese businessman Ziad Takieddine told the online investigative site Mediapart in 2016 that he delivered suitcases from Libya containing 5 million euros ($6.2 million) in cash to Sarkozy and his former chief of staff, Claude Gueant.

Takieddine repeated his allegations during a live interview with France’s BFM TV on Wednesday night.

He claimed he personally handed a suitcase containing 2 million euros (about $2.5 million) in cash to Sarkozy at the then-candidate’s apartment and another suitcase with 1.5 million euros (about $1.9 million) to Sarkozy and a close aide at the French Interior Ministry. Sarkozy was interior minister at the time.

Takieddine alleged he gave a third suitcase with 1.5 million euros in cash to the aide alone. He said the money was not meant to finance Sarkozy’s presidential campaign in 2007, but to honor contracts between France and Libya.

“He’s a real liar,” Takieddine said of Sarkozy.