The announcement came minutes into a joint session of the Zimbabwean Parliament in Harare, convened to prise the 93-year-old from power, CNN reported.
As the Speaker read out a letter from Mugabe, lawmakers broke out in thunderous applause and cheers.In the streets outside, crowds erupted in rapturous celebrations, dancing and cheering in joy, some raising their fists and waving Zimbabwean flags.
Mugabe's announcement was an acknowledgment of the inevitable. In reality, he lost his grip on power six days ago when the country's top generals launched what amounted to a military coup, placing the veteran leader under house arrest.
The military intervention came after Mugabe had fired his Vice President, Emmerson Mnangagwa, in an apparent attempt to clear a path for his wife, Grace, to succeed him.
Read alsoZimbabwe's ruling party sacks Robert Mugabe as leader – BBC That prospect horrified the generals and other senior elements in Mugabe's ZANU PF party, who despise Grace Mugabe's lavish lifestyle and were suspicious of her political ambitions.
Mugabe's resignation marks the end of an era in Zimbabwe. He ruled the country with an iron fist for almost four decades and is the only leader the nation has known since it achieved independence from Britain in 1980.