LONDON — Fireworks and celebratory gunfire rang out in Tunisia and Lebanon, South Africans recalled Nelson Mandela's euphoric release from prison and two words — "Congrats Egypt" — dominated social media sites as the world cheered the ouster of Egypt's Hosni Mubarak.
European officials on Friday saluted the resilience of the demonstrators in Cairo — who thronged the Egyptian capital for 18 days to demand their rights despite attacks from pro-government thugs — and pledged assistance to help Egypt make a transition to a democratic government.
"In their eyes, you can see what power freedom can have," German Chancellor Angela Merkel said of the protesters. She said that by stepping down, Mubarak had rendered "a last service to the Egyptian people." Merkel herself had lived under an autocratic regime, growing up in communist East Germany.
But there were guarded comments from authoritarian governments. Foreign Minister Sergei Lavrov said the developments showed "authorities have approached the problem responsibly" and called for a rapid return to stability. The United Arab Emirates said it had confidence in the armed forces' ability to manage Egypt's affairs "in these delicate circumstances."
Another message coming from officials worldwide was concern for the future of a critical partner in the Middle East peace process and guilt over the close partnership that many Western countries shared with Mubarak's regime.
"Mubarak's tyranny was typical across the region, and it is Europe's shame that we sustained them," said Edward McMillan-Scott, the European Parliament's vice president for democracy and human rights.
Merkel expressed hope that whoever comes to power works to "uphold peace in the Middle East and respect the treaties concluded with Israel," while French President Nicolas Sarkozy said reforms were needed quickly so Egypt "can keep its place in the world at the service of peace."
President Barack Obama, whose administration has walked a fine line between backing the protesters' demands and supporting long-term ally Mubarak, said Mubarak's departure is the beginning, not the end, of the transition to democracy in Egypt.
Whatever the uncertainty, euphoria ruled the streets. In Tunisia, where a revolution pushed dictator Zine El Abidine Ben Ali into exile just last month and gave inspiration to the Egyptian protests, cries of joy and a thunderous honking of horns greeted the news. In Beirut, fireworks and celebratory gunfire erupted over the capital only moments after Egyptian Vice President Omar Suleiman said Mubarak had handed power over to the military. In the West African nation of Mauritania, pedestrians and cars filled the capital of Nouakchott to celebrate.
In South Africa, officials noted that Mubarak's resignation took place exactly 21 years to the day after Mandela's historic release from prison.
Some European and U.S. officials have worried that instability in Egypt could throw the peace process between Israelis and Palestinians into chaos — and provide an opening for Islamist forces such as Egypt's Muslim Brotherhood. Many are also worried that the military takeover may not necessarily spell an end to the rights abuses perpetuated during Mubarak's nearly three decades in power.
Foreign Minister Radek Sikorski of Poland, whose own nation threw off repressive communist rule 21 years ago, said the changes sweeping Egypt "create both hope and anxiety." Amnesty International's Secretary General Salil Shetty agreed, saying that Mubarak's departure "is not the end."
"The repressive system that Egyptians have suffered under for three decades has not gone away and the state of emergency remains in place," he said.
The sentiment was shared across Europe, whose leaders had increasingly pushed Mubarak to open up Egyptian society and worked quickly to shake off any links to the deposed leader. Sarkozy described Mubarak's resignation as "necessary," while Swiss officials froze assets belonging to Mubarak and his family.
An unusual joint statement from EU President Herman Van Rompuy, foreign policy chief Catherine Ashton and Jose Manuel Barroso, head of the executive European Commission, said the EU "salutes the courage of the Egyptian people" and called for the formation of a civilian government.
United Nations Secretary-General Ban Ki-moon also called for the "early establishment of civilian rule," while British Foreign Secretary William Hague warned Egypt's newly installed military authorities against backsliding.
In South Africa, U2 rehearsed Friday at the country's historic FNB Stadium, known as Soccer City when it hosted the World Cup last year.
"This continent is on fire," said lead singer Bono, adding he hoped Egypt would benefit from leadership as visionary as Mandela's.