Morsi's detention, under a court order for a renewable 15 days, further raised tensions as those applauding the decision and those demanding the Islamist leader's reinstatement flooded parts of Cairo and other cities.
Two people were killed in the Mediterranean city of Alexandria in clashes between the rivals protesters, despite a massive police and military deployment to secure the rallies.
The Arab world's most populous country has been convulsed by violence for the past three weeks, with some 200 people killed since Morsi's ouster by the army on July 3, many in clashes between his Islamist supporters and his opponents.
At least 19 people were wounded in the Alexandria violence, in which riot police intervened. Ten people were wounded in clashes in Cairo, medical officials and the health ministry said.
The overwhelming number of Friday's marches have remained peaceful, with thousands of Morsi's supporters gathering in a north Cairo square before setting off through the streets.
At Cairo's Tahrir Square, tens of thousands of anti-Morsi supporters gathered in response to a call by the army chief General Abdel Fattah al-Sisi on Egyptians to show their support for a security clampdown on opposition.
The protesters waved Egyptian flags and held up posters of Sisi, who served as Morsi's defence minister before ousting him.
A leader of Morsi's Muslim Brotherhood, Essam al-Erian, said in a statement Islamists would respond to the detention of their leader with "peaceful marches".
The Brotherhood however reacted angrily to his detention order, saying it smacked of tactics used by the regime of Hosni Mubarak, Egypt's long-time strongman toppled in a popular uprising in 2011.
NJF/NJF