By Wyre Davies
BBC News, Jerusalem
Israel's Prime Minister Ehud Olmert has shown himself in the past to be a great political survivor, but he has finally bowed to the inevitable.
Ehud Olmert has been under pressure to resign over a corruption inquiry
Plagued by corruption allegations, he has been under increasing pressure in recent weeks from the media and his political opponents.
But critical to his decision to stand aside as leader of his centrist Kadima party after internal elections in September were the mounting calls for his resignation from leading figures within his own coalition government.
Many analysts in Israel had thought Mr Olmert might try to fight out his current battles and stand in the internal party elections.
But although the 62-year-old has previously brushed off scandals and accusations that would have sunk other leaders, it seems this time it had been made clear to him that he had no chance of winning.
He has been seen as a weak prime minister ever since Israel failed to defeat Hezbollah in the Lebanon war in 2006 and his government's handling of the war came in for heavy criticism in an official report.
HAVE YOUR SAY
This is a good move and long overdue, Olmert is a weak PM in a country that cannot afford to have weak leaders.
Then came the latest in a string of corruption-related scandals - allegations that, when mayor of Jerusalem and later as a government minister, he received tens of thousands of dollars in loans and gifts from an American businessman and spent some of it on watches, expensive hotel suites and first-class air travel.
This was followed by further claims that he had double-billed expenses claims for trips abroad.
Mr Olmert has not been charged and says he has done nothing illegal, but had said he would resign if indicted.
The veteran is now essentially trying to secure a safe transition that will keep the ruling coalition in tact under new leadership.
After the Kadima primary elections, scheduled for 17 September, he will stand down as party leader.
He will then be caretaker prime minister until his successor as Kadima leader has formed a new coalition government before he finally bows out.
Among his likely Kadima successors, Foreign Minister Tzipi Livni is riding high in the polls, and is also the favourite of the party's main coalition partner Labor.
EHUD OLMERT'S POLITICAL LIFE
1993: Begins 10-year stint as mayor of Jerusalem
2005: Leaves right-wing Likud party with former Prime Minister Ariel Sharon to form Kadima
2006: Takes over as leader when Ariel Sharon suffers a stroke
2007: Helps relaunch Israeli-Palestinian peace talks after seven-year hiatus
2008: Announces plans to resign
But Transport Minister and former Defence Minister Shaul Mofaz, Public Security Minister Avi Dichter and Interior Minister Meir Shetrit are also in the running.
Failure to form a coalition could result in a general election, something both Kadima and the Labour party are keen to avoid at the moment, as both are struggling with low poll ratings.
As things stand, elections would probably mean the end of their ruling coalition and the return to power of right-wing Likud, led by Binyamin Netanyahu.
In his half-hour speech live on Israeli television, Mr Olmert stressed that he would fight to achieve a peace deal with the Palestinians, right to his last day in office.
An optimist until the end, Mr Olmert said he thought the prospects for peace were closer than ever.
But history shows it takes a strong leader to make peace, and the problem remains that he is a weak prime minister and many doubt that he has the necessary weight behind him to forge an agreement.
Whether another leader can bring that authority, we will have to wait and see.