France’s former President Nicolas Sarkozy departed a Paris prison on Monday after a Paris appeals court granted him release under judicial supervision.

His release comes less than three weeks after he began serving a five-year sentence for criminal conspiracy in a scheme to finance his 2007 election campaign with funds from Libya.

Sarkozy’s black car with tinted windows was seen leaving the prison in the direction of his home in western Paris.

The former president, 70, is banned from leaving French territory and from being in touch with key people including co-defendants and witnesses in the case, the court said.

Sarkozy became the first former French head of state in modern times to be sent behind bars after his conviction on Sept. 25.

He denies wrongdoing.

He was jailed on October 21 pending appeal but immediately filed for early release.

Monday’s proceedings didn’t involve the motives for the sentencing.

French law provides that release should be the general rule pending appeal, while detention should be reserved for those considered dangerous or at risk of fleeing to another country, or to protect evidence or prevent pressure on witnesses.

Sarkozy’s lawyer, Christophe Ingrain, on Monday praised “the normal application of the criminal procedure code” in a brief statement.

“The next step is the appeals trial and our job, for Nicolas Sarkozy and us, is to prepare for this appeals hearing,” he told reporters after leaving court.

In a rare decision, the court specifically banned Sarkozy from being in touch with Justice Minister Gérald Darmanin.

Darmanin, a former conservative who once considered Sarkozy as his mentor before rejoining President Emmanuel Macron's centrist party in 2017, paid a visit to Sarkozy in prison last month.

Some French magistrates criticized the move as undermining the independence of judges.

AP video by Alexander Turnbull and Oleg Cetinic