CAIRO - The popular uprising in Egypt triumphed Friday as President Hosni Mubarak surrendered to the will of a leaderless revolution and stepped down after 30 years of autocratic rule over the Arab world's most populous nation.

Mubarak became the second Arab leader in a month to succumb to his people's powerful thirst for freedom. His resignation sparked joyful pandemonium in Cairo and across the country, but the next steps for Egypt were unclear as the armed forces took control and gave little hint of how they intend to govern.

For the moment, however, Egyptians were suffused with a sense that they had made world history, on par with chapters such as the fall of the Berlin Wall and the collapse of communism in Eastern Europe. In a region long devoid of democracy and stifled by repression, Egyptians celebrated with fireworks, a cacophony of horns and a sea of red-white-and-black national flags.

"I feel Egyptian, like I am a new person," said Mustafa Sayed, 52, among tens of thousands of protesters who marched to Mubarak's presidential palace to demand that he leave. "I feel as though my handcuffed wrists and my sealed lips are now free."

Mubarak's abrupt abdication came just 19 hours after the 82-year-old leader had appeared on national television to declare defiantly that, despite the swelling protests against his rule, he had no plans to quit. He left it to his handpicked vice president, Omar Suleiman, to announce his resignation; Mubarak and his wife, Suzanne, then left Cairo, apparently bound for internal exile in the Red Sea resort of Sharm el-Sheikh.

While Egypt's new military chiefs pledged to allow "free and honest" elections, it remained unclear how and whether power might be ceded to civilians, after six decades in which the army has been the country's dominant force.

It was also unclear whether demonstrators' success in winning Mubarak's removal might be followed by a quest for retribution against the former president, his wealthy family or members of his notoriously brutal security services. A group of Egyptian lawyers said they would submit a complaint to the country's attorney general seeking the prosecution of the Mubarak family on corruption charges.

But for at least one day, Egyptians were able to celebrate, backed by international statements of support. "Egypt will never be the same," President Obama said at the White House. " . . . And I know that a democratic Egypt can advance its role of responsible leadership not only in the region, but around the world."

In Tahrir Square, the plaza in central Cairo where the protests began Jan. 25, hundreds of thousands of Egyptians jumped up and down, pumped their fists, waved their flags, hugged and cried. If the people were nervous about their nation's uncertain future, they submerged their anxieties for the moment.

"I feel free," shouted Nihal Shafiq, a 30-year-old film director. "This is a great moment and it hit us by surprise. It is a new beginning for Egypt after 30 years of suffering."

The uprising came soon after the ouster of Zine el-Abidine Ben Ali from Tunisia. Ben Ali, 74, fled the North African country Jan. 14, after four weeks of steadily escalating riots protesting his 23 years in power.

Angered by Mubarak's refusal to resign Thursday night, Egyptians responded early Friday with their biggest demonstrations yet. Ignoring fears that Mubarak might order a brutal crackdown, people of all ages and classes calmly gathered in central squares across the country and in unison demanded a change.

As they did, demonstrators made common cause with thousands of soldiers who had been deployed to maintain order but stood by and allowed Egyptians to express themselves peacefully.

The soldiers' sympathies became clearer as Mubarak's end drew near. In front of the presidential palace, soldiers draped posters of martyred protesters over their tanks. Senior officers served juice and tea to the crowds.

Egypt's military chiefs, who had pledged not to hinder the protests as long as they remained nonviolent, said they were taking political control reluctantly. In a statement, they said they were "studying" what to do next, but assured the people that "there is no alternative to the legitimacy you demand." They also guaranteed "free and honest" elections, without specifying when they would be held or under what conditions.

The statement was read on television by an unidentified military spokesman in uniform. The spokesman paid homage to the estimated 300 Egyptian civilians who were killed during the 18-day revolution, extending a formal salute. He also said that the Egyptian military "pays our respects" to Mubarak for his long service to the country but did not salute the former commander in chief, who had earlier agreed not to seek reelection in September.

The armed forces are led by Defense Minister Mohammed Hussein Tantawi, 75, and the military chief of staff, Lt. Gen. Sami Enan. Neither spoke publicly during the revolution. It is unclear how much power they will reserve for themselves, or if they will hand control to transitional leaders.

Also unclear was the fate of Suleiman, a former general and chief of Egyptian intelligence until he was appointed as vice president by Mubarak last month in an early concession that failed to stifle the protests.

Nabil Fahmy, Egypt's former ambassador to the United States, said there was no evidence that the military had carried out a coup. "The army did not take control," he said. "They were handed this power which suggests that this power is not in their ambition and they do not consider themselves to be an alternative."

Fahmy and other members of Egypt's civilian elite have called for creating a temporary government of national unity, or a small council to oversee the transition until elections can be held.

"It is difficult to predict exactly how things will turn out, for after all this is a completely new situation that we have not experienced before," he said. "There will be a lot of details and negotiations through a complicated process that will require time and the inclusion of all."

Essam el-Erian, a leader of the fundamentalist Muslim Brotherhood movement, banned under Mubarak, called for the chief of Egypt's constitutional court to oversee a transition to new elections and civilian rule.

Some protest organizers said the demonstrations in Tahrir Square will continue, albeit on a smaller scale, until the military agrees to formal negotiations. Others expressed optimism that the army will agree to their terms.

"Egypt is going to be a democratic state," Wael Ghonim, a Google executive who was detained for 12 days by Egyptian security forces for encouraging the protests, told CNN. "We are much stronger than all these guys."

The military chiefs pledged to repeal Egypt's repressive state-of-emergency law as soon as calm was restored, but did not offer specifics. Mubarak imposed the law in 1981 after the assassination of his predecessor, Anwar Sadat, and used it as a tool to restrict political opponents.

Sarah Lee Whitson, Middle East executive director for Human Rights Watch, estimated that 5,000 people are detained in Egypt under the state-of-emergency law on the basis of political affiliation or political views. Despite the military's pledge, she said there is no indication that the law will be repealed soon.

Special correspondents Sherine Bayoumi and Samuel Sockol contributed to this report.