Former French president Nicolas Sarkozy has been sentenced to five years in jail after being found guilty of criminal conspiracy over efforts by close aides to procure funds for his 2007 presidential bid from Libya during the rule of late dictator Muammar Gaddafi.
The sentence, which will soon make Sarkozy the first post-war president of France to be imprisoned, was harsher than many expected and stunned allies and foes alike.
Sarkozy was acquitted by a Paris court of all other charges on Thursday, including corruption and receiving illegal campaign financing.
But the ruling means the former president will spend time in jail even if he appeals.
The prison sentence is enforceable immediately, with the judge saying Sarkozy would have just a short period to put his affairs in order before prosecutors call on him to head to jail.
That must happen within a month. French media said Sarkozy would be summoned on 13 October to be told when he would be jailed.
'Scandalous' ruling, Sarkozy says
As he exited the courtroom, Sarkozy, visibly moved, expressed his outrage at what he said was a "scandalous" ruling.
"If they absolutely want me to sleep in jail, I will sleep in jail, but with my head held high," he told reporters, adding that he was innocent. "I will not apologise for something I didn't do."
"What happened today ... is of extreme gravity in regard to the rule of law, and for the trust one can have in the justice system," he said of the ruling, as his wife, model and singer-songwriter Carla Bruni, stood by him.

Sarkozy, who has always denied the charges, was accused of making a deal with Gaddafi in 2005, when he was France's interior minister. Source: ABACA / Abd Rabbo-Mousse
The judge said there was no proof that Sarkozy made such a deal with Gaddafi, nor that money that was sent from Libya reached Sarkozy's campaign coffers, even if the timing was "compatible" and the paths the money went through were "very opaque".
But she said Sarkozy was guilty of criminal conspiracy for having let close aides get in touch with people in Libya to try and obtain campaign financing.
The 70-year-old had been on trial since January, in a case he said was politically motivated.
The court found him guilty of criminal conspiracy between 2005 and 2007, after which he was president and covered by presidential immunity.
Sarkozy was also ordered to pay a €100,000 ($178,000) fine.
Despite his legal battles, and having his Legion of Honour, France's highest distinction, stripped in June, Sarkozy remains an influential figure on the French political stage.