Updated

In their tens of thousands, they cheered, ignited firecrackers and honked horns as soon as the army announced President Mohamed Morsi's rule was over, ending Egypt's worst crisis since its 2011 revolt.

Camped out in Cairo's iconic Tahrir Square for a week, the anti-Morsi protesters let loose with an outburst of joy when military chief General Adel Fattah al-Sisi brought them the news they all were waiting to hear.

As the din rang out for over an hour in Tahrir, epicentre of the Arab Spring uprising that ousted dictator Hosni Mubarak, groups of overjoyed revellers carried members of the security forces on their shoulders as heroes.

Across town near Nasr City, where Morsi's Islamists had gathered in a counter-demonstration, one celebrator Omar Sherif said: "It's a new historical moment. We get rid of Morsi and the Muslim Brotherhood".

The protesters had been forced to wait anxiously until the announcement at around 9:00 pm (1900 GMT), with the crowd building up slowly as day turned to night.

"Egypt, Egypt" and "Leave, Leave," they chanted outside the defence ministry building, as reports came in that the army was deploying dozens of armoured vehicles near Islamist gatherings elsewhere in the capital.

With broad grins, they sang patriotic songs they have become accustomed to hearing as the same tunes have been pumped out on state television in the weeks leading up to the crisis.

"Morsi deserves his end. He was the president of the Muslim Brotherhood, not of Egypt," said Cairo resident Amr Mohammed, who carried his 40-day-old daughter in his arms as he marched to the Ittihadiya presidential palace.

A group of housewives put a table in the street and handed out dates and free cups of water, as celebrations erupted when a television station reported that Morsi had been placed under house arrest.

Upon hearing the rumour, one elderly man kneeled down on an Egyptian flag and said "Allahu Akbar" (God is greatest).

That report proved unfounded, but officials did say security forces had imposed a travel ban on Morsi and his top Islamist allies over their alleged involvement in a 2011 prison escape.

Abdel Khalek Abo Risha, 56, who came to the protest from Tanta city in the Nile Delta, said: "I only expect Morsi to be toppled. No other options".

Nehal Serry, a woman who helped to organise the refreshments, said: "This is for the sake of Egypt. We are celebrating that we are getting rid of Morsi".

The gathering in Tahrir dwarfed a rally by the embattled president's supporters in Nasr City.

"Come here O Sisi, Morsi isn't my president," the protesters chanted, referring to army chief and defence minister, General Sisi.

The powerful military had issued a 48-hour deadline on Monday for Morsi to meet the "people's demands", a day after millions of protesters took to the streets across the troubled country calling for him to resign.

But thousands of people had gathered in Nasr City in a show of support for Morsi, despite an attack by a group of men that killed 16 of them and left 200 injured overnight.

That was before the military moved in to disperse them, however, with AFP correspondents reporting they had seen dozens of armoured personnel carriers ominously heading to Islamist gatherings at Cairo University, Heliopolis, and Nasr City.

A military officer said later that the "Islamists are not allowed to get out of Rabaa Square today, so that they can't cause any chaos".

Dozens of military armoured personnel carriers completely surrounded the square, with troops putting up barbed wire and helicopters buzzing overhead.

Those inside could be heard firing birdshot, although they were outgunned and remained stuck behind the barricades.

Army vehicles surrounded the protest outside the Rabaa al-Adawiya mosque in Nasr City, where Morsi supporters have been camping out for days vowing to defend his legitimacy.

"It's a coup d'etat against an elected president," said Ahmed Abulmagd in Nasr City. "Morsi was betrayed."

Other parts of the capital were eerily quiet, as many chose to stay at home in fear of becoming caught up in more bloodshed.

"I'm so worried, the future of my country will be written in the next few minutes," said one taxi driver as he waited for passengers in a neighbourhood where the shops were all boarded up.