HARARE, Zimbabwe — Giddy with joy and finally free to speak out, vast throngs of demonstrators turned Zimbabwe’s capital into a carnival ground on Saturday in a peaceful outpouring of disdain for President Robert Mugabe and calls for him to quit immediately.

Still clinging to his now-powerless post, the longtime leader has been put under house arrest by the military.

People in Harare, meanwhile, clambered onto tanks and other military vehicles moving slowly through the crowds; danced around soldiers walking in city streets, and surged in the thousands toward the building where Mugabe held official functions, a symbol of the rule of the now-93-year-old man who took power after independence from white minority rule in 1980. There, in a situation that could have become tense, the protesters instead showed deference to the small number of soldiers blocking their way and eventually dispersed.

It was a historical day when the old Zimbabwe, a once-promising African nation with a disintegrating economy and a mood of fear about the consequences of challenging Mugabe, became something new, with a population united, at least temporarily, in its fervor for change and a joyful openness that would have seemed fanciful even a few days ago.

The euphoria, however, will eventually subside, and much depends on the behind-the-scenes maneuvering to get Mugabe to officially resign, jump-start a new leadership that could seek to be inclusive, and reduce perceptions that the military staged a coup against Mugabe. The president was to meet military commanders on Sunday in a second round of talks, state broadcaster ZBC reported.

“The common enemy is Robert Mugabe. That’s for starters,” said 37-year-old Talent Mudzamiri, an opposition supporter who was born shortly after Zimbabwe’s independence.

He had a warning for whoever takes over Zimbabwe: “If the next leader does the same, we are going to come out again.”

Many Zimbabweans believe the most likely candidate will be Emmerson Mnangagwa, a former vice president with close military ties whose dismissal by Mugabe triggered the intervention of the armed forces, which sent troops and tanks into the streets this week, effectively taking over the country. The increasing presidential ambitions of Mugabe’s wife, Grace, a polarizing figure who denounced Mnangagwa amid a factional battle within the ruling ZANU-PF party, alarmed those who feared a dynastic succession.

“Leadership is not sexually transmitted,” read a poster at the Harare rallies. Other signs denounced “Gucci Grace,” a reference to the first lady’s record of high-end shopping expeditions outside Zimbabwe, which suffered hyperinflation in the past and is currently struggling with a cash shortage and massive unemployment.

The discussions over Mugabe’s fate come ahead of a key ruling-party congress next month, as well as scheduled elections next year.

The president, who is believed to be staying at his private home in Harare, a well-guarded compound known as the Blue Roof, is reported to have asked for more time in office. He has been deserted by most of his allies, with others arrested. The ruling party has turned on him, asking for a Central Committee meeting this weekend to recall both him and his wife, who heads the women’s league of the party. Impeachment is also a possibility when Parliament resumes Tuesday.