The judge also fined him 1m shekels ($289,000) and ordered that 560,000 shekels in assets be seized.
According to BBC, Olmert's lawyers said he was innocent and would appeal. If he is unsuccessful he will become the first former head of government in Israel to be jailed.
The 68-year-old was convicted in March over a real estate deal that took place while he served as mayor of al-Quds (Jerusalem).
The Tel Aviv District Court found he had accepted a 500,000-shekel ($145,000) bribe from the developers of a controversial apartment complex, known as Holyland, for which planning and zoning laws were changed, and another 60,000 shekels for a separate project.
This jail sentence is a dramatic fall from grace for a man who was once one of the most powerful figures in Israel.
It is also likely to end any hopes of a political comeback for Ehud Olmert.
Recently, as he criticized the Israeli government's handling of the so-called peace talks with the Palestinians, it seemed he still held ambitions to return to public life.
However, the judge in this case said that Olmert's crimes involved "moral turpitude", meaning he will be barred from office for seven years after serving his sentence.
In his memoirs, Olmert claims he came very close to a peace deal with the acting Palestinian Authority Chief Mahmoud Abbas in 2008.
But in his three years in office he also took Israel into two bloody, armed conflicts - the 2006 war with the Lebanese resistance group Hezbollah, and a three-week offensive on Gaza in 2008-2009 that left some 1,400 Palestinians and 13 Israelis dead.
Now corruption has been added to Olmert's political record.
Ten other regime officials and businesspeople were convicted alongside Olmert. The sentences handed down on Tuesday against six of them ranged from three to seven years.
Judge David Rozen said bribery offences "contaminate the public sector" and "cause the structure of government to collapse".
He described Olmert’s offences as "noxious" and said he was guilty of "moral turpitude", which under Israeli law would preclude him from running for public office for seven years after finishing his jail term.
Olmert reportedly stood quietly in the courtroom with his head bowed. His lawyers had sought a non-custodial sentence.
The judge told him to report to prison on September 1, effectively giving his lawyers time to lodge their planned appeal.
"He did not take a bribe. He did not receive a bribe. He sees himself as innocent, and it is with those feelings that he will be going to the Supreme Court to appeal," Olmert's lawyer, Eli Zohar, told reporters.
Yolande Knell reports on the real estate deal that brought down Israel's former Prime Minister Ehud Olmert
Olmert served as prime minister from 2006 to 2009, until a flurry of corruption allegations led to his resignation.
BA/BA