The announcement came during a parliamentary hearing to impeach him and launches the nation into a new era as uncertain as it is hopeful.
The move caps an astonishing eight-day crisis, which started when the military took over last week in order to block the rise to power of Mugabe’s wife and her faction within the ruling Zanu-PF party then developed into a popular revolt against the aging autocrat.
A letter submitted to parliament by the 93-year-old said his decision to resign was voluntary on his part.
Wild jubilation broke out among MPs when Jacob Mudenda, the speaker, told the parliament and cheers and celebrations spread through the streets of Harare.
Impeachment proceedings against Mugabe began earlier on Tuesday as the ruling party, Zanu-PF, attempted to remove him from office.
Thousands of Zimbabweans had turned up outside parliament to urge on MPs, chanting, dancing and waving placards in Africa Unity Square.
Though some still consider the former guerrilla a hero of the liberation struggle, many more reviled Mugabe as a dictator prepared to sacrifice the economic well-being of 13 million people to remain in power.
His fall will reverberate across a continent where hundreds of millions still suffer the authoritarian excesses of rapacious, ruthless rulers, are denied justice by corrupt or incompetent officials, and struggle to hold even elected governments to account.
The way is now clear for Emmerson Mnangagwa, the vice-president fired by Mugabe 13 days ago, to take power. He was appointed the interim leader of the Zanu-PF at the meeting on Sunday.
The military has said it has no intention of staying in power and according to the constitution, Mnangagwa, as vice-president, should now take the place of Mugabe as head of state and commander-in-chief of the armed forces.
Shortly before legislators met, Mnangagwa broke more than a week of silence to add his voice to those calling for the ageing leader to step down.
Until recently Mugabe’s vice-president and right-hand man, Mnangagwa, 75, is a veteran of Zimbabwe’s liberation wars and a former spy chief who has close relations with the commanders who led the takeover.
Opposition leaders in Zimbabwe have called for the formation of an inclusive transitional government but risk being sidelined by the powerful army and Zanu-PF.
Mugabe has been under house arrest and key allies of his wife, Grace, removed from power since the military took charge last week.
The ruling Zanu-PF party, which at the weekend voted to make Mnangagwa its leader and demote Mugabe to a rank-and-file member, introduced the motion to impeach and the opposition seconded it.
Mugabe had refused to resign until the impeachment proceedings were underway.
The case for impeachment against Mugabe focused heavily on his age and the machinations of his wife for “usurping constitutional power”, leaving a man who is still respected as a hero of the liberation struggle against the colonial rule as much dignity as possible.
Mnangagwa had said in a written statement released on Tuesday morning that he backed impeachment as an “ultimate expression of the will of the people outside an election.”
He had fled into exile earlier this month after being ousted from his position in government and Zanu-PF by a faction allied to Grace Mugabe. His supporters are widely believed to be behind the coup - The Guardian