HARARE, Zimbabwe — Robert Mugabe, who has ruled Zimbabwe since independence in 1980, resigned as president on Tuesday shortly after lawmakers began impeachment proceedings against him, according to the speaker of Parliament.
The speaker read out a letter in which Mr. Mugabe said he was stepping down “with immediate effect” for “the welfare of the people of Zimbabwe and the need for a peaceful transfer of power.”
Lawmakers erupted into cheers, and jubilant residents poured into the streets of Harare, the capital. It seemed to be an abrupt capitulation for Mr. Mugabe, 93, the world’s oldest head of state and one of Africa’s longest-serving leaders.
“It’s the best thing that’s ever happened to Zimbabwe,” Perseverance Sande, 20, said in central Harare just minutes after news of Mr. Mugabe’s resignation began spreading and crowds of people started singing around her. “I’ve been waiting so long for this moment.”
Mr. Mugabe — who once proclaimed that “Only God will remove me!” — had refused to step down even after being expelled on Sunday from ZANU-PF, the political party he had led for decades.
Then on Tuesday, members of ZANU-PF introduced a motion of impeachment, invoking a constitutional process that had never before been tested.
The party’s historical political rival, the Movement for Democratic Change, seconded the motion, a striking sign of the consensus in the political class that Mr. Mugabe must go — one that formed with astonishing speed after the military took Mr. Mugabe into custody last Wednesday, signaling an end to his 37-year rule.
Debate on the impeachment motion had begun when the speaker suddenly interrupted the proceedings to read what he said was a letter of resignation delivered by Mr. Mugabe’s representatives.
In Africa Unity Square, hundreds of people gathered minutes after the word spread from Parliament.
“I’m happy,” said Presca Nzendora, 32, a street vendor. “Bob has resigned! We were starving because of him.”
Nicholas Nyamaka, a 65-year-old taxi driver, said, “I used to think it would never come. It’s a dream come true. So finally the suffering is over.”
For nearly four decades, Mr. Mugabe managed to stay at the helm by handing out the spoils of power to his allies — and by crushing dissent. He oversaw the massacre of thousands of civilians in the 1980s and outmaneuvered rivals in his party and in the opposition. Even in his 90s and weakened by age, he kept potential successors at bay.
But he pushed too hard by trying to position his wife, Grace Mugabe, 52, as his successor. She entered politics only two years ago, had no role in the nation’s liberation war and treated with open contempt politicians who had been waiting decades to succeed her husband.
The chain of events leading to Mr. Mugabe’s downfall started on Nov. 6, when he fired his vice president, Emmerson Mnangagwa, a close ally of the military, and then tried to arrest the nation’s top military commander a few days later.
Mr. Mugabe had finally come down against the military and its political allies in a long-running feud inside the governing party.
After the military took Mr. Mugabe into custody, ZANU-PF expelled him as its leader on Sunday. But Mr. Mugabe stunned the nation that evening with a televised address in which he refused to step down as president. Pressure from within the country and from abroad had been building on Mr. Mugabe to resign, but observers had warned that the country might have to brace itself for lengthy impeachment proceedings.
The next step was for Parliament to form a committee to investigate the impeachment motion’s allegations that Mr. Mugabe had violated the Constitution; that he had allowed his wife to usurp power; and that he is too old to fulfill his duties.
According to Zimbabwe’s Constitution, a president can be removed for serious misconduct, violating the Constitution or “inability to perform the functions of the office because of physical or mental incapacity.” Committees must investigate and present evidence. Finally, Parliament can remove the president with a two-thirds vote in each of the two legislative chambers.
Mr. Mnangagwa, the former vice president who has not been seen in public since leaving for South Africa on Nov. 6, said he had refused the president’s invitation to return for talks to Harare. Despite having the backing of the powerful war veterans association and the military, Mr. Mnangagwa, 75, said he feared for his personal security in Zimbabwe.
“I told the president that the current political and constitutional crisis in the country is not a matter between him and myself but between the people of Zimbabwe and President Mugabe,” Mr. Mnangagwa said in a statement.
“He should take heed of this clarion call by the people of Zimbabwe to resign so that the country can move forward and preserve his legacy,” he added.
Mr. Mnangagwa’s words, as well as his continued absence, appeared to be part of an effort by his allies to distance him from the military intervention and to portray it as a reflection of the popular will. The army stepped in two days after the president attempted to arrest the country’s top military commander, Gen. Constantino Chiwenga, a close ally of Mr. Mnangagwa.
At least a semblance of legitimacy — especially for a government under Mr. Mnangagwa, who is known as the enforcer of some of Mr. Mugabe’s most ruthless policies — will be critical in gaining recognition from regional powers, Western governments and international lenders. Zimbabwe, which no longer has its own currency and perennially struggles to pay government workers, became a pariah in the West after the state-backed invasion of white-owned farms in the early 2000s.
Mr. Mnangagwa’s role as the likely successor to Mr. Mugabe has engendered some skepticism.
“He is now saying it is important to be part and parcel of what the people are saying when the people’s voices have been ignored so far,” said Okay Machisa, the executive director of ZimRights, a human rights group.
In keeping with efforts to minimize the backlash against last week’s intervention, the military allowed Mr. Mugabe to try to convene a cabinet meeting Tuesday morning. Just five ministers turned up; 17 others attended impeachment meetings.