Mr. Olmert described his fall as “painful and strange” at the time, and the weeks leading up to the decision for his release have been no less tumultuous.
The police have been looking into the possibility that Mr. Olmert mishandled classified information when he gave part of a manuscript that he had written behind bars to one of his lawyers to take out of the prison.
Mr. Olmert’s lawyers argued that the manuscript would be subject to military censorship before publication and that there had been no security breach.
Mr. Olmert — who as prime minister led a monthlong war against Hezbollah in Lebanon in 2006 and held extensive peace negotiations with the Palestinians and indirect talks with Syria — complained during a recent parole board hearing that the authorities were turning him into a “traitor,” according to Israeli news reports.
Israel has remained silent about a 2007 airstrike that was widely attributed to it and that took place during Mr. Olmert’s tenure, destroying a nuclear reactor that was under construction in Syria.
The police inquiry this month prompted a public uproar and increased sympathy for Mr. Olmert after a raid at the offices of Yedioth Books, the publisher of his memoir, as well as at the home of his editor. Officers seized material that was unrelated to Mr. Olmert’s book, a move that many Israeli critics saw as vastly overstepping their authority. A judge examining a case brought by Yedioth Books for the return of the materials warned that the raids and seizures undermined freedom of speech and the freedom of the press, cornerstones of the country’s democratic system.
Amid the brouhaha, Mr. Olmert suffered chest pain and was hospitalized for a week. He was discharged from the hospital on Tuesday.
Mr. Olmert’s legal troubles began in 2008, two years after he became prime minister, and he was forced to resign from office under the growing weight of police investigations. A lawyer by profession, he entered public life in his 20s. He was convicted of taking bribes as mayor of Jerusalem — a role he filled from 1993 to 2003 — in part to facilitate the construction of a large housing complex known as Holyland, despite fierce local opposition.
Originally sentenced to six years in prison, Mr. Olmert had his prison term reduced significantly after the Israeli Supreme Court overturned a main part of his conviction relating to the housing project. He was also serving time for a separate case involving his relations with an American businessman, Morris Talansky. Some of the charges related to a period when he was serving as a government minister, but none pertained to his time as prime minister.
Mr. Olmert is not expected to make a formal political comeback anytime soon; the law bars him from holding office for seven years.
There was little sign of a public outcry as news of the parole board’s decision filtered through Israeli society; many observers seemed ready to move on.
Some political rivals have come out in support of Mr. Olmert in recent weeks. Naftali Bennett, the education minister and leader of the right-wing Jewish Home party, wrote in a Facebook post on June 23: “It is time to release Ehud Olmert. Despite our differences of opinion, there is no argument over Prime Minister Olmert’s decisive contribution to the security of Israel.” He added, “The time has come for a degree of mercy.”