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 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.
Lawmakers learned of Mr. Mugabe’s resignation as they were still discussing the motion to impeach him. After meeting in the Parliament building earlier in the day, they had moved from the city center to convene in a large conference hall at the Rainbow Towers Hotel, a former Sheraton.
Mr. Mugabe’s justice minister, Happyton Bonyongwe, suddenly walked up to the stage. Lawmakers booed him loudly because of a rumor that he had been offering bribes to sway votes against impeachment. The justice minister whispered into the ear of Mr. Mudenda and handed him a letter.
Calling the lawmakers to order, the speaker announced that he had received an urgent communication from the president. As the crowd grew quiet, Mr. Mudenda — with a wide smile across his face — read out the letter.
Lawmakers immediately screamed and shouted. Once-bitter rivals from ZANU-PF and the Movement for Democratic Change — which have engaged for decades in often bloody battles — shook hands and hugged one another.
In Africa Unity Square, the capital’s main public area, scattered shouts were heard a few minutes after the announcement by the speaker. Then, as word began spreading by mouth and by phone, the shouts, cries and honking of cars rose in a deafening crescendo. Hundreds of people ran to the square, hugging and jumping, as the crowd soon swelled into the thousands.
“I’m happy,” said Presca Nzendora, 32, a street vendor who was hugging a friend, jumping up and down. “Bob has resigned! We were starving because of him.”
Bryan Moyo, 30, who works in internet security, ran into the middle of the square in his dark suit and red tie. “Thirty-seven years is not a joke,” he said. “He’s the only president I’ve ever known. It’s indescribable. It’s been hell. I feel like we’ve been liberated a second time.”
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, clearing the way for Mrs. Mugabe to take over the presidency at some point. Mr. Mugabe 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 to Harare for talks. 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. Mr. Mnangagwa was accused of orchestrating the crackdown in the 1980s in which thousands of members of the Ndebele ethnic group were killed. He was an avid supporter of Mr. Mugabe’s most controversial economic policy — the expropriation and redistribution of land that had been controlled by white farmers since the era of colonialism. He was also accused of being behind deadly violence in 2008 a bid to rig polls in favor of Mr. Mugabe, a claim he denies.
“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 on Tuesday morning. Just five ministers turned up; 17 others attended impeachment meetings.
While Mr. Mugabe’s resignation caused immediate jubilation in the streets and among lawmakers, for many the reaction was more complex: Mr. Mugabe had occupied a central role in the nation’s four-decade history and in its founding mythology, which all Zimbabweans are taught in primary school. He was a tyrant, many said, but he was also the nation’s father figure.
Even as military leaders met Mr. Mugabe in recent days before the cameras, their body language showed extreme deference. His fiercest critics saved their harshest words for Mr. Mugabe’s wife and her political allies, often describing the president, who has become visibly frail in the past two years, as a victim of the people surrounding him.
Christopher Mutsvangwa, the head of the war veterans association and one of Mr. Mnangagwa’s closest allies, led efforts to remove Mr. Mugabe from power. But as ZANU-PF lawmakers met separately before Parliament convened, he sometimes sounded melancholy about Mr. Mugabe, with whom he had worked decades before a falling out last year.
Mr. Mutsvangwa, who once served as Zimbabwe’s ambassador to China, compared Mr. Mugabe and his wife to Mao Zedong and Jiang Qing, the Chinese leader’s fourth wife, who, toward the end of Mao’s life, assumed great power as part of the Gang of Four.
“He’s a traumatized old man,” Mr. Mutsvangwa said of Mr. Mugabe, suddenly growing quiet.
Even among the celebrants in Unity Square, some wore quiet, almost sad expressions.
David Mushakwe, 35, a car electrician, stood quietly as he watched hundreds of mostly young men jumping on trucks on the edge of Unity Square, in front of Parliament. Lawmakers had met in the building in the morning and then moved to a hotel in another section of the city for a joint session of Parliament in the afternoon.
“I just want to say to His Excellency, ‘Go and rest now, our father,’” Mr. Mushakwe said. “We still love you. But we’re happy today. We’re hoping now for a better future.”