CAIRO - Egypt formally detained Mohamed Morsi Friday for allegedly abetting militants in murdering policemen and staging prison escapes, as clashes during massive rallies by his opponents and loyalists killed two people.

The ousted Islamist president’s detention, under a court order for a renewable 15 days, further raised tensions as those applauding the decision and those demanding his reinstatement flooded parts of Cairo and other cities.

Two people were killed in the Mediterranean city of Alexandria in clashes between the rival protesters, despite a massive police and military deployment.

The Arab world’s most populous country has been rocked by violence for the past three weeks, with some 200 people killed since the army ousted Morsi 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, 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. In Tahrir Square, an AFP correspondent reported more than 100,000 anti-Morsi protesters gathered in response to a call from army chief General Abdel Fattah al-Sisi for Egyptians to show their support for a security clampdown on “terrorism”. Tens of thousands of army supporters also rallied outside the presidential palace, waving Egyptian flags and holding posters of Sisi who was Morsi’s defence minister before ousting him. A leader of Morsi’s Muslim Brotherhood, Essam al-Erian, said in a statement they would respond to his detention with “peaceful marches”.

The accusations against Morsi include conspiring with Palestinian Hamas militants in attacks that killed policemen and staging prison breaks during the revolt against Mubarak, in which Morsi escaped along with other political inmates.

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.

He is also accused of “premeditated murder of some prisoners, officers and soldiers, and kidnapping officers and soldiers,” state news agency MENA said on Friday. Morsi is also suspected of conspiring to “storm prisons and destroy them... allowing prisoners to escape, including himself”. Detention orders of the type ordered by the court 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, saying Mubarak’s regime was “signalling ‘we’re back in full force’.”

A court had on June 23 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.

Morsi’s election victory in June 2012 had been hailed by Hamas 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.

The military has said there would be no reneging on a roadmap to fresh elections next year, drawn by the interim government installed after Morsi’s ouster.

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 in aid, a US official said.

But Washington did finally send the interim leaders a veiled warning on Wednesday by suspending the delivery of four promised F-16 fighter jets.

“The interim government’s strategy clearly consists of politically sidelining the Muslim Brotherhood until the elections,” said German Middle East expert Michael Lueders.

London-based rights group Amnesty International criticised Sisi’s call for rallies.

“Given the security forces’ routine use of excessive force, such a move is likely to lead to yet more unlawful killings,” said Hassiba Hadj Sahraoui, Amnesty’s deputy director of its Middle East and North Africa programme.