Robert Mugabe resigned as Zimbabwe's president on Tuesday, shortly after parliament began an impeachment process to end his nearly four decades of rule.
The 93-year old clung on for a week after an army takeover and expulsion from his own ruling ZANU-PF party, which also told him to leave power.
Wild celebrations broke out at a joint sitting of parliament when Speaker Jacob Mudenda announced Mugabe's resignation and suspended the impeachment procedure.
The origin of Mugabe's sudden downfall lies in rivalry between members of Zimbabwe's ruling elite over who will succeed him, rather than popular protests against his rule.
The army seized power after Mugabe sacked ZANU-PF's favourite to succeed him, Emmerson Mnangagwa, to smooth a path to the presidency for his wife Grace, 52, known to her critics as "Gucci Grace" for her reputed fondness for luxury shopping.
Mnangagwa, a former security chief known as The Crocodile, is expected to take over as president.
The move looks set to bring an end to Zimbabwe's worst-ever political crisis since the country won independence from Britain in 1980.
On the streets, the news sparked an explosion of wild celebration, with car horns honking and people erupting into ecstatic cheers and frenzied dancing.
People celebrate in the streets of Harare after the resignation of Robert Mugabe.
"I Robert Gabriel Mugabe in terms of section 96 of the constitution of Zimbabwe hereby formally tender my resignation... with immediate effect," said the letter which was read out by parliamentary speaker Jacob Mudenda.
"My decision to resign is voluntary on my part. It arises from my concern for the welfare of the people of Zimbabwe and my desire to ensure a smooth, peaceful and non-violent transfer of power that underpins national security, peace and stability."
It capped an unprecedented week in which the military seized control and tens of thousands of ordinary Zimbabweans took to the streets in an extraordinary show of defiance to demand that he leave.
Breakdancing and flags
"We are just so happy that things are finally going to change," Togo Ndhlalambi, a 32-year-old hairdresser, told AFP.
Men were breakdancing, women were singing and children were in tears, all brandishing national flags and praising General Constantino Chiwenga who led the army takeover as the news began to sink in.
"It's shocking, that guy is powerful, very powerful," said Barber Wright Chirombe who was also taking part in the euphoric celebrations.
Mugabe had ruled Zimbabwe almost unopposed since independence in 1980 but efforts to position his wife Grace as his successor triggered fury in the military that had underpinned his regime.
His grip on power was shattered last week when armoured military vehicles took to the streets, blockaded parliament and placed the president under house arrest in an operation that had all the hallmarks of a coup.
But the generals stressed they were simply "arresting" criminals around Mugabe -- a reference Grace's supporters -- and they even allowed the one-time liberation hero to appear at a public function and deliver a televised speech.
As the crisis grew, the ruling ZANU-PF party, an instrument of Mugabe's ruthless decades-long rule, removed him as party leader and began parliamentary proceedings to have him impeached.
His likely successor is former vice president Emmerson Mnangagwa, whose dismissal on November 6 triggered the crisis.
A former close ally of Mugabe, Mnangagwa had been Grace Mugabe's chief rival to succeed him. Grace has not been seen since the start of the crisis.
However, under Zimbabwe's constitution, it is second Vice President Phelekezela Mphoko who would ordinarily take over as head of state.
Veterans of the independence war -- who were also formerly key Mugabe allies -- had also turned against him, demanding he stand down immediately and organising last weekend's mass protests.
On Saturday, in scenes of public euphoria not seen since independence, huge crowds marched and sang their way through Harare and other cities in peaceful celebrations to mark his fading power.
The demonstrations drew citizens of all ages and races, jubilant that Mugabe's fate had been sealed.
In central Harare, a group of young men tore down a green metal street sign bearing Mugabe's name and smashed it repeatedly on the road.
Such open dissent would have would have been routinely crushed by security forces before this week's shock events.
The majority of Zimbabweans had only known life under Mugabe's rule, which was defined by violent suppression, economic collapse and international isolation.Last updated: November 21 2017 08:39 PM