HARARE, Zimbabwe -- Zimbabwe's President Robert Mugabe, who once vowed to rule for life, resigned on Tuesday, succumbing to a week of overwhelming pressure from the military that put him under house arrest, lawmakers from the ruling party and opposition who started impeachment proceedings and a population that surged into the streets to say 37 years in power was enough.

The capital, Harare, erupted in jubilation after news spread that the 93-year-old leader's resignation letter had been read out by the speaker of parliament, whose members had gathered to impeach Mugabe after he ignored escalating calls to quit since a military takeover. Well into the night, cars honked and people danced and sang in a spectacle of free expression that would have been impossible during his years in power, whose early promise after the end of white minority rule in 1980 was overtaken by economic collapse, government dysfunction and human rights violations.

"Welcome to the new Zimbabwe!" people chanted outside the conference centre where the lawmakers had met. "This is the best day of my life," one man declared as euphoric citizens celebrated on top of cars, clustered around a tank and shook hands with soldiers who were hailed as saviours for their role in dislodging Mugabe, a once-formidable politician who crushed dissent or sidelined opponents but, in the end, was a lonely figure abandoned by virtually all his allies.

"Change was overdue. ... Maybe this change will bring jobs," said 23-year-old Thomas Manase, an unemployed university graduate.

It was a call echoed by many, and which pointed to the challenges ahead for Zimbabwe, which used to be a regional breadbasket but has since suffered hyperinflation, cash shortages, chronic mismanagement and massive joblessness. And, while Zimbabweans seemed almost universally united in their wish to see an end to the Mugabe era, the hard work of building institutions and preparing for what they hope are free and fair elections scheduled for next year has yet to begin.

Mugabe, who was the world's oldest head of state, said in his resignation letter that legal procedures should be followed to install a new president "no later than tomorrow."

"My decision to resign is voluntary on my part and arises from my concern for the welfare of the people of Zimbabwe and my desire for a smooth, non-violent transfer of power," Mugabe said in the message read out by parliamentary speaker Jacob Mudenda.

Recently ousted Vice-President Emmerson Mnangagwa was to take over as the country's leader within 48 hours so that he can move "with speed to work for the country," said a ruling party official, Lovemore Matuke. Mnangagwa, who fled the country after his Nov. 6 firing, "is not far from here," Matuke added.

Mugabe's resignation ended impeachment proceedings brought by the ruling ZANU-PF party after its Central Committee voted to oust him as party leader and replace him with Mnangagwa, a former justice and defence minister who served for decades as Mugabe's enforcer, a role that earned him the moniker, "Crocodile." Many opposition supporters detest Mnangagwa and believe he was instrumental in the army killings of thousands of people when Mugabe moved against a political rival in the 1980s.

So far, Mnangagwa has used inclusive language, saying in a statement before Mugabe's resignation that all Zimbabweans should work together to advance their nation.

"Never should the nation be held at ransom by one person ever again, whose desire is to die in office at whatever cost to the nation," Mnangagwa said.

Zimbabwe's military commander, Gen. Constantino Chiwenga, warned people not to target old adversaries following Mugabe's resignation. "Acts of vengeful retribution or trying to settle scores will be dealt with severely," he said.

U.N. Secretary-General Antonio Guterres urged Zimbabweans to maintain calm. The U.S. Embassy in Zimbabwe said Mugabe's resignation "marks an historic moment" and that "the path forward" should lead to free and fair elections. British Foreign Secretary Boris Johnson said Mugabe was "a despot who impoverished his country" and his exit is a "moment of joy" for Zimbabwe.

The end for Mugabe came when his wife, Grace Mugabe, positioned herself to succeed her husband, leading a party faction that engineered Mnangagwa's ouster. The prospect of a dynastic succession alarmed the military, which confined Mugabe to his home last week and targeted what it called "criminals" around him who allegedly were looting state resources -- a reference to associates of the first lady.

In his early days as leader, after a long war between black guerrillas and the white rulers of Rhodesia, as Zimbabwe was known before independence, Mugabe stressed education and built new schools. Tourism and mining flourished. But in 2000, violent seizures of thousands of white-owned farms began, causing agricultural production to plunge. A land reform program was supposed to take much of the country's most fertile land and redistribute it to poor blacks, but Mugabe instead gave prime farms to ZANU-PF leaders and loyalists, relatives and cronies.

As the years went by, Mugabe was widely accused of hanging onto power through violence and vote fraud, notably in a 2008 election that led to a troubled coalition government after regional mediators intervened. Still, he cast himself as a voice of pride and defiance in modern Africa, a message that resonated in many countries that had experienced Western colonialism or intervention.

Mugabe once said he wanted to rule for life, expressing a desire to live until he is 100 years old. He also said he was ready to retire if asked to do so by his supporters.

A year ago, he said: "If I am to retire, let me retire properly."