He was convicted of trying to bribe a judge in 2014 – after he’d left office – by suggesting he could secure a prestigious job for him in return for information about a separate case.
Sarkozy, 66, is the first former French president to get a custodial sentence.
His lawyer says he will appeal. Sarkozy will remain free during that process which could take years.
In the ruling, Judge Christine Mée said the conservative politician “knew what [he] was doing was wrong”, adding that his actions and those of his lawyer had given the public “a very bad image of justice”.
The crimes were specified as influence-peddling and violation of professional secrecy.
If Sarkozy’s appeal is unsuccessful, he could serve a year at home with an electronic tag, rather than go to prison.
Who is Nicolas Sarkozy?
Nicolas Sarkozy served one five-year term as president from 2007. He adopted tough anti-immigration policies and sought to reform France’s economy during a presidency overshadowed by the global financial crisis.
Critics nicknamed him “bling-bling”, seeing his leadership style as too brash, celebrity-driven and hyperactive for a role steeped in tradition and grandeur.
His celebrity image was reinforced by his marriage to supermodel and singer Carla Bruni in 2008. In 2012 he lost his re-election bid to Socialist François Hollande.
Since then he has been targeted by several criminal investigations.
What is the corruption case about?
Sarkozy was on trial with two co-defendants, his lawyer Thierry Herzog and Gilbert Azibert, a senior judge.
The case centred on phone conversations between Sarkozy and Herzog that were taped by police in 2014.
Investigators were looking into claims that Sarkozy had accepted illicit payments from the L’Oreal heiress Liliane Bettencourt for his 2007 presidential campaign.
The prosecution convinced the court that Sarkozy and Herzog had sought to bribe Azibert with a prestigious job in Monaco in return for information about that investigation.
French media reported that Sarkozy was heard telling Herzog: “I’ll get him promoted, I’ll help him.”
On Monday Herzog and Azibert were also sentenced to three years in jail, two of them suspended.
From wronged politician to convict
Nicolas Sarkozy is no stranger to legal investigations – since he left the presidency he has been the object of half a dozen – but up until now his record sheet has been clean. There was plenty of mud, but none of it stuck.
Half an hour in a courtroom in Paris’s new Palais de Justice changed all that. Judge Mée read out a verdict that spared nothing, and no-one. Sarkozy, Thierry Herzog and Gilbert Azibert all knew perfectly well what they were doing, she said.
They were trading confidential information for professional favours. And that was corruption in any book.
It is not the end of the affair, by any stretch. The appeal could take years. His team will continue to argue that the case rested on ill-gotten evidence – chance eavesdroppings on confidential phone-chats between a man and his lawyer.
But from today Sarkozy cuts a different figure. Before he was the wronged ex-president, fighting back against a left-wing judicial cabal. Now he has been convicted in a court of law.
What other accusations is Sarkozy facing?
He is due to go on trial next month over the so-called Bygmalion affair, in which he is accused of having overspent in his unsuccessful 2012 campaign.
Prosecutors are also investigating claims that Sarkozy received funding for his 2007 campaign from Libya’s then-leader Muammar Gaddafi.
Sarkozy has already been cleared in connection with the Bettencourt case. He had said all investigations against him were politically motivated.
Despite his legal woes he has remained popular in right-wing circles, a year away from another presidential election.