Former French president Nicolas Sarkozy has been released from jail, three weeks into a five-year prison term for taking part in a criminal conspiracy.

He will be subject to strict judicial supervision and barred from leaving France ahead of an appeal trial due to be held next year.

On 21 October, the former centre-right president, 70, was sentenced to five years for conspiring to fund his 2007 election campaign with money from late Libyan dictator Muammar Gaddafi.

His legal team immediately filed a request seeking his release.

Writing on social media after the release, Sarkozy stated his energy is focused solely on the single goal of proving my innocence. He added, The truth will prevail... The end of the story is yet to be written.

Sarkozy's car was seen leaving La Santé prison in Paris just before 15:00 (14:00 GMT), less than an hour-and-a-half after a court agreed to his early release. Soon after, he was seen arriving at his home in western Paris.

Christophe Ingrain, one of Sarkozy's lawyers, hailed his client's release as a step forward and said they would now be preparing for the appeal trial expected in March.

One condition of Sarkozy's release is he does not contact any other witnesses in the so-called Libyan dossier or any justice ministry employees.

During his incarceration, he was visited by Justice Minister Gérald Darmanin, which prompted complaints from lawyers highlighting a potential conflict of interest.

Sarkozy described his time in solitary confinement as gruelling and a nightmare, reaffirming his claims of innocence and expressing gratitude towards the prison staff.

Sarkozy, who served as president from 2007 to 2012, is the first former French leader to be imprisoned since World War Two.