Israel's Ehud Olmert was acquitted of major corruption charges on Tuesday but convicted of breach of trust, a lesser offence, in what was widely seen as a stunning victory for the former prime minister.
Mr. Olmert resigned as the country's leader in 2008 after the allegations surfaced, cutting short his pursuit of a peace deal with the Palestinians.
"There is justice in Jerusalem," a gaunt-looking Mr. Olmert, 66, said after the ruling. Smiling broadly, he left the courthouse to a smattering of applause, hugging and kissing well-wishers.
The verdict, which defied widespread expectations of a full conviction, capped the first criminal trial of a former Israeli premier. The case touched off a debate on corruption among Israel's ruling class.
A three-judge Jerusalem court found Mr. Olmert not guilty of corruption charges that included allegations he received $150,000 in cash bribes from a U.S. businessman and knowingly double-billed Israeli charities for overseas fund-raising trips.
But it said he was in breach of trust when, as trade and industry minister before becoming Israel's leader in 2006, he dealt with projects that involved one of his long-time friends.
The conviction carries a maximum penalty of three years' imprisonment, and the court said it would begin hearing arguments on sentencing in September.
Mr. Olmert, addressing reporters outside the court, described the offence as a "procedural irregularity - not corruption".
When he announced his resignation in September 2008, Mr. Olmert said he wanted to battle the allegations and clear his name. He stayed on as caretaker until March 2009 when Prime Minister Benjamin Netanyahu's government was sworn in.
Mr. Olmert said he had achieved significant progress in talks with the Palestinians aimed at securing a final Middle East peace deal, offering an Israeli withdrawal from much of the occupied West Bank.
But no agreement was reached and negotiations held under Mr. Netanyahu collapsed in 2010 in a dispute over Israeli settlement building on land Palestinians want for a state.
"I think one can't ignore the far-reaching ramifications in Israel and outside it as a result of the decision to bring me to trial," Mr. Olmert said after the verdict.
Ruling on some of the most serious charges in the case, the court said prosecutors had failed to prove that payments Mr. Olmert received, before he became prime minister, from U.S. businessman Morris Talansky were illegal.
It also found he had broken no laws in helping to arrange meetings between Mr. Talansky, who ran a mini-bar business, and hotel owners Mr. Olmert knew.
The Israeli newspaper Haaretz described the verdict on its website as a "crushing defeat" for the prosecution. The popular Ynet news site called the outcome a "legal earthquake", confounding widespread expectations of a triple conviction.
Mr. Olmert is also battling, in a separate case, charges over the construction of a hulking luxury apartment complex that dominates a Jerusalem hilltop.
Prosecutors said millions of dollars in bribes were paid to Mr. Olmert, Jerusalem's mayor from 1993 to 2003, and other civil servants to ensure the approval of plans for the Holyland towers. Mr. Olmert has denied this.
Israel has already witnessed a former head of state put behind bars.
Former president Moshe Katsav was convicted last year of raping an aide when he was a cabinet minister in the late 1990s and molesting or sexually harassing two other women who worked for him during his 2000-2007 term as president. He began serving a seven-year prison sentence in December.