According to the letter, Halevi wants to handle the current ceasefire and a potential transition to a permanent ceasefire over the next six weeks, writes the Israeli media.
Halevi also writes that he is leaving at a time when the military has had "significant successes" – but admits that not all of Israel's goals with the war in Gaza have been achieved.
The army will continue to fight to further dismantle Hamas and its ability to govern, ensure that hostages return and make it possible for Israelis who have been displaced by the fighting to return home, he announces.
Netanyahu thanks Halevi for his service. Opposition leader Yair Lapid also praises the army chief – and urges Prime Minister Netanyahu and his government to follow in his footsteps and resign for the same reasons.
In a televised speech later on Tuesday, Halevi claims that Israel has killed nearly 20,000 Hamas members in Gaza.
In total, at least 47,107 people are reported to have been killed in the Gaza Strip over the 15 months that the war has raged, according to figures from Hamas, which the UN has also deemed reliable.
Shortly after Halevi's announcement, Yaron Finkelman, the army's southern commander, also announced that he is leaving his post.