Halutz stepped down at the end of an already turbulent day for Olmert: hours earlier, the justice ministry ordered police to launch a criminal investigation into his conduct in the sale of Israel's second-largest bank before he became prime minister last year.
Troops, bereaved families and even members of Israel's tightly knit military elite have been calling for Halutz's head ever since the monthlong war against Lebanese Hezbollah fighters ended on August 14.
Israel launched the full-scale assault just hours after Hezbollah captured two Israeli soldiers and killed three others in a July 12 cross-border raid.
The country went into the war as a united front against Hezbollah, but that solidarity collapsed after the fighting ended without the fighters being crushed or the captured soldiers recovered.
More than 1,300 people were killed on both sides, most in Lebanon, according to the UN, Israeli and Lebanese officials.
Israel claims it killed 600 fighters, but that number has not been substantiated, and Lebanon says most of its casualties were civilians.
Northern Israel, meanwhile, was nearly paralysed by the nearly 4,000 rockets fired from Lebanon during the fighting, and 159 Israelis were killed, including 39 civilians who died in rocket attacks.
Criticism of the military's preparedness and tactics swelled after the battles ended without a clearcut Israeli victory.
Questions about the wisdom of 11th-hour battles and reports of food and water shortages fuelled demands for inquiries into the war's conduct and the resignation of Israel's wartime leaders.
Halutz had acknowledged the shortcomings, but had earlier resisted pressure to resign.
The military said on Wednesday that Halutz decided to step aside now that dozens of military inquiries into various aspects of the war had been concluded.
"Now that this process has been completed, the chief of staff has asked to resign immediately," the military said in a brief statement.
None of the inquiries concluded he should quit or be dismissed.
|Olmert is said to have tried unsuccessfully to|
dissuade Halutz, left, from quitting [Reuters]
But Army Radio reported that Halutz said in the letter that he was taking responsibility for the outcome of the war.
"For me the concept of responsibility is everything," Halutz wrote, according to Army Radio.
Both Olmert and Peretz accepted the chief of staff's resignation, the military said. There was no immediate word on when the resignation would go into effect.
The Haaretz newspaper website cited Olmert's bureau as saying the prime minister tried to dissuade Halutz, but accepted his resignation after realising the military commander was determined to step aside.
Peretz spoke with Halutz by phone after receiving the letter of resignation and expressed regret over his decision, a defence ministry spokesman said.
The two were to meet on Wednesday after Halutz meets other generals, Goor Tsalalyachin, a spokesman, said.
Meanwhile, Major-General Moshe Kaplinsky, who was dispatched to the Lebanon front to assume command during the war, told Israel TV last week that he would be a candidate for chief of staff after Halutz leaves. Kaplinski is currently serving as deputy chief of staff.
Another candidate is Major-General Gabi Ashkenazi, who has served in several command positions.