Cairo's Tahrir Square has erupted in an impromptu cacophony of cheering and fireworks as Egyptians celebrate the ouster of President Hosni Mubarak after a historic 18-day wave of pro-democracy demonstrations.

Several hundred thousand protesters packed into the central square screamed for joy Friday, waving Egyptian flags, blowing car horns, jumping up and down and chanting slogans such as: "Egypt is free," "God is great," "The people have brought down the regime."

CBC is there LIVE: Updates from our reporters VIDEO: View of Cairo celebrations David Common reports: "It's absolutely incredible … for 18 days these protesters have been involved effectively in an uprising that has turned into a revolution. A stunning development, particularly in this part of the world. Sober thought about what it all means comes tomorrow. A lot of fireworks, people dancing with fireworks, big spotlights being used on the crowd … it's turned very much into a party atmosphere. And still, thousands of people are pouring into Tahrir Square trying to grab on to this piece of history."

Egyptians wept and hugged each other. Others clambered on the tanks that have surrounded Tahrir Square.

"What we have here in Cairo, you never know when it's going to end," Ali Mikkawi, a former Canadian resident, told CBC News from the Egyptian capital.

"Certainly, this is one of the biggest parties ever that this country has seen. It’s everywhere. Everybody’s congratulating everyone," he said.

After 29 years in power, Mubarak reluctantly resigned and handed over power to the military.

The terse announcement was made live on state TV by a grim Vice-President Omar Suleiman at about 6 p.m. local time Friday.

"In the name of God the merciful, the compassionate, citizens, during these very difficult circumstances Egypt is going through, President Hosni Mubarak has decided to step down from the office of president of the republic and has charged the high council of the armed forces to administer the affairs of the country," Suleiman said in a five-minute address translated into English. "May God help everybody."

The announcement came as protesters filled squares in at least three major cities Friday, and marched on presidential palaces and the state TV building, key symbols of the authoritarian regime.

It was the biggest day of protests yet in the upheaval that began Jan. 25, growing from youth activists working on the internet into a mass movement that tapped into widespread discontent with Mubarak's authoritarian lock on power, corruption, economic woes and widespread disparities between rich and poor.

The country is now ruled by the Armed Forces Supreme Council, the military's top body consisting of its highest-ranking generals and headed by Defence Minister Field Marshal Mohamed Hussein Tanwawi.

Egyptian President Hosni Mubarak resigned Friday on the 18th day of anti-government protests. ((Jason Reed/Reuters))

In a brief statement on state TV Friday evening, army spokesman Ismail Etman praised Mubarak for stepping down "in the interests of the nation" and said he "salutes the martyrs" who lost their lives in the unrest.

Ahead of Friday's announcement, Mubarak flew to his palace in the Red Sea resort of Sharm el-Sheikh, where he often lives and works during the winter. The resort is about 400 kilometres outside of Cairo.

Mubarak, a former air force commander became president after the 1981 assassination of Anwar Sadat by Islamic radicals.

Mubarak's decades-long uninterrupted rule was achieved by rigged elections and a hated police force accused of widespread torture to ensure his control. He resisted calls for reform even as public bitterness grew over corruption, deteriorating infrastructure and rampant poverty in a country where 40 per cent live below or near the poverty line.

Country has been 'liberated'

The announcement that Mubarak would resign came a day after he sought to cling to power, handing some of his authorities to Suleiman while keeping his title, in an apparent move to appease protesters.

Nobel Peace laureate Mohammed ElBaradei, whose young supporters were among the organizers of the protest movement, told Al Jazeera, "Today, my dream has come true. Unity is crucial at this stage. Egyptian people want to look forward but not backwards," he said.

Egypt's Vice-President Omar Suleiman addressed the nation on television Friday, announcing that Mubarak had resigned and handed power to the army. ((Egyptian State TV/Reuters))

He had a message for the Egyptian people: "You have gained your liberty, you have gained your chance to catch up to the rest of the world. Make the best of it, God bless you."

Mohamed el-Katatni, a senior member of the Muslim Brotherhood, Egypt's biggest opposition group, said Egyptians had achieved the main goal of their popular uprising.

"I salute the Egyptian people and the martyrs. This is the day of victory for the Egyptian people. The main goal of the revolution has been achieved," he told Reuters.

Safwan Abou Stat, a 60-year-old protester in Tahrir Square, echoed the feeling of others by saying, "Finally we are free. From now on, anyone who is going to rule will know that these people are great."

A wave of jubilation swept through the Middle East at news of Mubarak's resignation as celebratory gunfire erupted in Lebanon and car horns blared in Tunisia.

'Difficult days' ahead: Obama

Political leaders in Europe and North America reacted with relief.

"By stepping down, President Mubarak responded to the Egyptian people's hunger for change," U.S. President Barack Obama said in Washington, D.C.

Obama said there would be "difficult days" ahead, but added that he was confident Egyptians would find a peaceful way forward.

"For Egyptians have made it clear that nothing less than genuine democracy will carry the day," he said.

EU foreign policy chief Catherine Ashton praised the resilience of Egypt's protesters and said that Mubarak, by standing down, "has listened to the voices of the Egyptian people and has opened the way to faster and deeper reforms."

Prime Minister Stephen Harper said Canada will be pushing for free and fair elections in Egypt and respect for the rule of law. He also urged Egypt to respect its treaties and pursue peace in the Middle East.