Zimbabwe's President Robert Mugabe has resigned, parliament speaker Jacob Mudenda has said.
A letter from Mr Mugabe said that the decision was voluntary and that he had made it to allow a smooth transition of power.
The surprise announcement halted an impeachment hearing that had begun against him.
Lawmakers roared in jubilation and people have begun celebrating in the streets.
Mr Mudenda said moves were under way to ensure a new leader could take over by late on Wednesday.
UK Prime Minister Theresa May said Mr Mugabe's resignation "provides Zimbabwe with an opportunity to forge a new path free of the oppression that characterised his rule".
She said that Britain, "as Zimbabwe's oldest friend", will do all it can to support free and fair elections and the rebuilding of the Zimbabwean economy.
Prominent Zimbabwean opposition politician David Coltart tweeted: "We have removed a tyrant but not yet a tyranny".
Robert Mugabe has been in power since independence in 1980. Mr Mugabe has won elections, but over the past 15 years these have been marred by violence against political opponents.
He has presided over a deepening economic crisis in Zimbabwe, where people are on average 15% poorer now than they were in 1980.
"I am the happiest person under the sun right now, because I always believed that Mugabe was going to step down in my lifetime and it has happened," human rights activist Linda Masarira told the BBC.
Robert Mugabe - Timeline of a political life
1924: Born
1964: Imprisoned by Rhodesian government
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
Source: bbc.com
