Mass rallies by supporters and opponents of Mohamed Morsi swept Egypt, as the authorities formally detained the ousted Islamist president accusing him of conspiring with the Palestinian group Hamas.
Morsi had aided and abetted militants in the murder of policemen and the staging of prison breaks, said officials.
The country's new rulers moved against Morsi shortly before clashes between rival protesters in the Mediterranean city of Alexandria left seven people dead, a health ministry official Khaled el-Khateeb, told AFP.
Those clashes, in which another 194 were injured, came despite a massive police and military deployment, said Khateeb.
Ten people were wounded in clashes in Cairo, medics and the health ministry said.
The overwhelming number of Friday's marches remained peaceful, however, with tens of thousands of Morsi supporters gathering in a north Cairo square.
Hundreds of thousands of anti-Morsi protesters gathered in Cairo's Tahrir Square and around the Itihadiya presidential palace.
They were answering a call from army chief General Abdel Fattah al-Sisi for Egyptians to show their support for a security clampdown on "terrorism".
A spokesman for army-installed interim president Adly Mansour said the numbers in Tahrir "affirmed the rejection of terrorism," state news agency MENA said.
The Islamist Anti-Coup Coalition however said that Friday's turn-out by its supporters proved that those who took part in the rallies "reject the bloody, military fascist coup that wants to set the wheel of history back".
"We believe the next two days will be decisive in the history of Egypt," the group said in a statement.
A leader of Morsi's Muslim Brotherhood, Essam al-Erian, said in a statement they would respond to his detention with "peaceful marches".
The Arab world's most populous country has been rocked by violence that has killed some 200 people since the army ousted Morsi on July 3.
Many of those killed have died in clashes between his supporters and opponents, and in militant attacks in the Sinai peninsula.
The accusations against Morsi include conspiring with Palestinian Hamas militants in attacks that killed policemen and staging prison breaks during the 2011 revolt that ousted president Hosni Mubarak.
Morsi had been detained with other Brotherhood leaders overnight on January 27, 2011, hours after the Islamist group said it would join the revolt against Mubarak. They later escaped from prison.
Signup to our newsletter and follow us on Facebook and Twitter!
He is also accused of "premeditated murder of some prisoners, officers and soldiers, and kidnapping officers and soldiers," MENA said.
Morsi is also suspected of conspiring to "storm prisons and destroy them... allowing prisoners to escape, including himself".
On June 23, a court said Hamas militants facilitated the escape of prisoners during the tumultuous 18-day uprising that forced out Mubarak.
Hamas, an offshoot of the Muslim Brotherhood which supports the Gaza militant group's fight against Israel, also denounced Morsi's detention.
"Hamas condemns this move since it is based on the premise that the Hamas movement is hostile," spokesman Sami Abu Zuhri told AFP.
Detention orders of the type issued by the court against Morsi are usually followed by moving a suspect to prison. The military has so far kept Morsi's whereabouts secret to avoid attracting protests by his supporters.
Gehad El-Haddad, a Brotherhood spokesman, denounced the detention order. Mubarak's regime was "signalling 'we're back in full force'," he said.
Hamas hailed Morsi's June 2012 election victory as a triumph for Islamists.
He helped negotiate a truce to halt fighting between Israel and Hamas in November on favourable terms for the Islamists, but also oversaw the closing of smuggling tunnels to Gaza.
The military has reportedly given Morsi's backers until the end of Friday to end sit-in protests they began after the army deposed him.
Egypt's army has said there will be no reneging on a roadmap to fresh elections next year, drawn by the interim government installed after Morsi's ouster.
But the Brotherhood and allied Islamist groups have rejected the interim government and vowed to press their protests until Morsi is reinstated.
Western nations are watching the crisis in Egypt with growing unease, fearing the military may be angling for a prolonged power grab.
The United States has decided not to label the army's overthrow of Morsi a "coup", a move that would trigger an automatic freeze of some $1.5 billion (1.1 billion euros) in aid, a US official said.
Nevertheless Washington on Wednesday suspended the delivery of four promised F-16 fighter jets.
Egypt's military is also facing a low-level insurgency in the Sinai. Militants there killed a civilian and wounded five soldiers in attacks in the region on Friday.