Robert Mugabe has resigned as president of Zimbabwe after 37 years in power, the speaker of the country's parliament has said.
A letter from Mr Mugabe said that the decision was voluntary and that he had made it to allow a smooth transfer of power, Reuters reports.
Thousands of Zimbabweans poured onto the streets of Harare after the surprise announcement and cars were hooting in the streets.
Some people were holding posters of Zimbabwean army chief Constantino Chiwenga and former vice president Emmerson Mnangagwa, whose sacking this month triggered the military takeover that forced Mugabe to resign.
The ruling Zanu-PF party said Mr Mnangagwa will succeed Mr Mugabe, and will be sworn in as president on Wednesday or Thursday.
MPs roared in jubilation at the announcement which halted an impeachment hearing against Mr Mugabe that had just begun.
The 93-year-old had clung on for a week after an army takeover and expulsion from his own ruling ZANU-PF party.
He made a televised speech to the nation on Monday, after being given an ultimatum by the ruling party, but stunned observers when he failed to say he was stepping down. His refusal to resign prompted the impeachment procedure, seen as the only legal way to force him out.
Since the crisis began, Mr Mugabe has been mainly confined to his "Blue Roof" mansion in the capital where Grace is also believed to be.
Mr Mugabe has been in power since independence in 1980.
His dismissal of Emmerson Mnangagwa as vice-president two weeks ago triggered the moves to oust him.
That decision was seen by many as clearing the way for Mr Mugabe's wife, Grace, to succeed her husband as leader. It angered the military leadership who stepped in and put Mr Mugabe under house arrest.
Mr Mnangagwa, the former vice president whose whereabouts are unknown after fleeing the country in fear for his safety, is a former security chief known as The Crocodile.
He was a chief lieutenant to Mr Mugabe for decades and stands accused of participating in repression against Zimbabweans who challenged the leader.
Reuters reported in September that Mr Mnangagwa was plotting to succeed Mr Mugabe, with army backing, at the helm of a broad coalition.
Mr Mugabe led Zimbabwe's liberation war and is hailed as one of post-colonial Africa's founding fathers and a staunch supporter of the drive to free neighbouring South Africa from apartheid in 1994.
But many say he has damaged Zimbabwe's economy, democracy and judiciary by staying in power for too long and has used violence to crush perceived political opponents. The country faces a foreign exchange payments crisis and roaring inflation.
Robert Mugabe: Timeline of a political life
- 1924: Born
- 1964: Imprisoned by Rhodesian government
- 1980: Wins post-independence elections
- 1996: Marries Grace Marufu
- 2000: Loses referendum, pro-Mugabe militias invade white-owned farms and attack opposition supporters
- 2008: Comes second in first round of elections to Morgan Tsvangirai who pulls out of run-off amid nationwide attacks on his supporters
- 2009: Amid economic collapse, swears in Mr Tsvangirai as prime minister, who serves in uneasy government of national unity for four years
- 2017: Sacks long-time ally Vice-President Emmerson Mnangagwa, paving the way for his wife Grace to succeed him. Army intervenes and forces him to step down
- BBC / Reuters