CAIRO (AP) - Cries of "Egypt is free" rang out and fireworks lit up the sky over Cairo's Tahrir Square where hundreds of thousands danced, wept and prayed in joyful pandemonium Friday after 18 days of mass pro-democracy protests forced President Hosni Mubarak to hand over power to the military, ending three decades of authoritarian rule.
Ecstatic protesters hoisted soldiers onto their shoulders and families posed for pictures in front of tanks in streets flooded with residents of the capital of 18 million people streaming out to celebrate. Strangers hugged strangers, some fell to kiss the ground, and others stood stunned in disbelief. Chants of "Hold your heads high, you're Egyptian" roared with each burst of fireworks overhead.
"I'm 21 years old and this is the first time in my life I feel free," an ebullient Abdul-Rahman Ayyash, born eight years after Mubarak came to power, said as he hugged fellow protesters in Tahrir, or Liberation, Square.
The military, which effectively carried out a coup at the pleas of protesters that it push Mubarak out, announced on state television that is was committed to shepherding demands for greater democracy and that it would announce the next steps soon, possibly including the dissolving of parliament and creation of a transitional government to lead reforms.
Mubarak's downfall at the hands of the biggest popular uprising in the modern history of the Arab world had stunning implications for the United States and the West, Israel, and the region, unsettling authoritarian rulers across the Mideast.
The 82-year-old leader was the epitome of the implicit deal the United States was locked into in the Middle East for decades: Support for autocratic leaders in return for their guarantee of stability, a bulwark against Islamic militants and peace — or at least an effort at peace — with Israel.
The question for Washington now was whether that same arrangement will hold as the Arab world's most populous state makes a potentially rocky transition to democracy, with no guarantee of the results.
At the White House, President Barack Obama said "Egyptians have inspired us" and said of the important questions that lay ahead, "I'm confident the people of Egypt can find the answers."
The United States at times seemed overwhelmed throughout the 18 days of upheaval, fumbling to juggle its advocacy of democracy and the right to protest, its loyalty to longtime ally Mubarak and its fears the fundamentalist Muslim Brotherhood — or more radical groups — could gain a foothold. His fall came 32 years to the day after the collapse of the shah's government in Iran — the prime example of a revolution that turned to Islamic militancy.
Washington's concerns frustrated the young protesters, who argued that while the powerful Brotherhood would have to play a future political role, its popularity would be diminished in an open system where other ideologies were freed to outweigh it.
Neighboring Israel watched with the crisis with unease, worried that their 1979 peace treaty could be in danger. It quickly demanded on Friday that post-Mubarak Egypt continue to adhere to it.
Any break seems unlikely in the near term: The military leadership supports the treaty. Anti-Israeli feeling is strong among Egyptians, and a more democratic government may take a tougher line toward Israel in the chronically broken-down peace process. But few call for outright abrogating a treaty that has kept peace after three wars in the past half-century.
From the oil-rich Gulf states in the east to Morocco in the west, regimes both pro- and anti-U.S. could not help but worry they could see a similar upheaval. Several of the region's authoritarian rulers have made pre-emptive gestures of democratic reform to avert their own protest movements.
The lesson many took: If it could happen in only three weeks in Egypt, where Mubarak's lock on power had appeared unshakable, it could happen anywhere. Only a month earlier, Tunisia's president was forced to step down in the face of protests.
Perhaps more surprising was the genesis of the force that overthrew Mubarak. The protests were started by a small core of secular, liberal youth activists organizing on the Internet who only a few months earlier struggled to gather more than 100 demonstrators at a time. But their work through Facebook and other social network sites over the past few years built a greater awareness and bitterness among Egyptians over issues like police abuse and corruption.
When the called the first major protest, on Jan. 25, they tapped into a public inspired by Tunisia's revolt and thousands turned out, beyond even the organizers' expectations. From there, protests swelled, drawing hundreds of thousands. The Muslim Brotherhood joined in. But far from hijacking the protests as many feared, it often seemed co-opted by the protesters, forced to set aside its hard-line ideology at least for now to adhere to democratic demands.
About 300 people were killed in the course of the turmoil.
Hosni Mubarak.
Hosni Mubarak has stepped down as the president of Egypt, handing control of the country to the armed forces. Mubarak stepped down after eighteen days of mass protests across the country.

"In these difficult circumstances that the country is passing through, President Hosni Mubarak has decided to leave the position of the presidency. He has commissioned the armed forces council to direct the issues of the state," said the vice president of Egypt, Omar Suleiman. Both houses of parliament and the cabinet are expected to be suspended following Mubarak's resignation the BBC reports, quoting Al-Arabiya.

In response to the resignation, Nobel Peace laureate Mohamed ElBaradei stated that "This is the greatest day of my life. The country has been liberated."

Mubarak had been Egypt's president for nearly 30 years.