Egyptian security forces surrounded a Cairo mosque full of supporters of ousted president Mohamed Morsi on Saturday as protesters planned fresh marches after street battles left more than 80 dead.
The tense stand-off at the Al-Fath mosque came after bloody clashes killed 83 people nationwide and resulted in the arrest of more than 1,000 alleged supporters of Morsi's Muslim Brotherhood.
The bloodshed, hot on the heels of the deaths of 578 people following a crackdown on Wednesday, has divided Egyptians as never before in recent history, splintering the army-installed interim government and inviting international censure.
At one entrance to the mosque, security forces stood between the besieged protesters and angry residents, who tried several times to force their way into the mosque.
Ahmed Sami, who wears a beard -- a traditional symbol of piety today associated with political Islam -- came to Al-Fath to look for friends inside.
"I'm afraid for their safety. I fear they will be brought out dead," he told AFP.
Mahmoud, a supporter of Morsi's Muslim Brotherhood who took part in a march against his ouster by the military, said protesters had come under fire and sought refuge inside the mosque.
In the large square outside Al-Fath, residents confronted bearded men, and women in Islamic headscarves.
In several parts of Cairo, residents detained people they deemed suspect and handed them over to security forces, in a sign that vigilante justice was beginning to take hold.
One protester said nearly 1,000 people were trapped in the mosque, which had earlier held the bodies of more than 20 people killed in Friday's clashes.
Television footage showed troops inside apparently trying to persuade the protesters to give themselves up.
One of the protesters told AFP by telephone that they were demanding they not be arrested, or attacked by hostile civilians outside.
Security officials quoted by the official MENA news agency said that "armed elements" had been shooting at security forces and police from inside the mosque.
Morsi's Freedom and Justice Party (FJP) pleaded for another "massacre" to be avoided after at least 578 people were killed across the country on Wednesday when police cleared protest camps set up by loyalists of the former president, deposed by the military on July 3.
The latest unrest started as Morsi supporters emerged from mosques in the capital to protest in what they billed as a "Friday of anger" following Wednesday's bloodbath.
Violence erupted almost immediately, with gunshots ringing out in Cairo and security forces firing tear gas.
An AFP correspondent counted at least 19 bodies in one Cairo mosque, while witnesses said more than 20 corpses had been laid out in another.
Elsewhere in Egypt, 10 people were killed by security forces and dozens injured in the canal city of Suez when they gathered to protest in defiance of the curfew.
Their deaths brought to 83 the number killed in nationwide violence although the FJP spoke of 130 dead in Cairo alone.
The demonstrations ended shortly after a night-time curfew came into effect but Anti-Coup Alliance spokesman Gehad El-Haddad told AFP that Morsi loyalists would hold "daily anti-coup rallies" going forward.
The interior ministry said "the number of Muslim Brotherhood elements arrested reached 1,004," including 558 in Cairo alone.
The Egyptian cabinet issued a defiant statement after the unrest, saying it was confronting a "terrorist plot."
"The cabinet affirms that the government, the armed forces, the police and the great people of Egypt are united in confronting the malicious terrorist plot by the Muslim Brotherhood," it said.
And the interior ministry, which authorised police to use live fire if government buildings came under attack, said several attempts to storm buildings had been foiled.
EU foreign policy chief Catherine Ashton described the violence as "shocking".
"I have asked member state representatives to debate and coordinate appropriate measures to be taken by the European Union in response to the situation in Egypt," she said.
Germany said it would review ties with Cairo, and joined France and Britain in calling for EU talks on the situation, which are expected to take place on Monday.
Pope Francis was following events with "mounting concern" and was praying for the rival sides to "choose the path path of dialogue and reconciliation," the Vatican press office said.
The United States has announced the cancellation of its biannual military exercise with Egypt, but stopped short of suspending $1.3 billion in annual aid.
Human rights organisation Amnesty International called for a full and impartial investigation into the bloodshed, saying the authorities' response to the protests had been "grossly disproportionate".
But the international response was not uniformly critical. Saudi Arabia and Jordan said they backed Egypt's fight against "terrorism".