The Egyptian army has warned it will use force against groups resorting to violence during rallies on Friday.
Army chief Gen Abdel Fattah al-Sisi has called on people to take to the streets to give the military a mandate to confront violence and "terrorism".
Supporters of Mohammed Morsi are also due to protest. He has been held since being ousted as president on 3 July.
Prosecutors say he is being detained over alleged links with the Palestinian militant groups Hamas.
State-run Mena news agency says Mr Morsi is being investigated over allegations of colluding with Hamas to storm police stations and jails during the 2001 uprising, "setting fire to one prison and enabling inmates to flee, including himself, as well as premeditated killing of officers, soldiers and prisoners".
Mr Morsi's Muslim Brotherhood has said it was aided by local residents in breaking out of prison, not foreigners.
Egypt's first democratically elected leader, Mr Morsi was ousted by the army after mass protests against him on the anniversary of his election. He has been held by the army at an undisclosed location since then.
Announcing the charges on Friday, Mena said the judicial detention was initially ordered for 15 days.
The BBC's Jim Muir in Cairo says the statement provides legal cover for the continued detention at a time when the UN and Western powers are calling for the ousted president to be released or properly charged.
On Thursday, military spokesman Col Ahmed Mohammed Ali said the army was respectful of peaceful protests, but said that violence or terrorism would be "dealt with decisively and with force".
A statement on a Facebook page affiliated to the military said: "We reaffirm that the Egyptian armed forces... never uses its weapons against its own people but will do so against violence and black terrorism which has no faith and no nation."
Since Mr Morsi was ousted dozens of people have died in clashes between supporters and opponents of the Islamist leader. Militants have also staged deadly attacks in the Sinai peninsula.
In his call for demonstrations on Wednesday, Gen Sisi said he was not calling for unrest. Military spokesmen have insisted that the army is not seeking to target any particular group.
The Tamarod movement that organised the protests which preceded Mr Morsi's removal has urged its supporters to take part in Friday's rallies.
"We call on all of the great Egyptian people to gather in the squares on Friday to officially demand that Mohammed Morsi be put on trial and to support the Egyptian armed forces in its coming war on terrorism," it said.
The Muslim Brotherhood, which backs Mr Morsi, said Gen Sisi was "calling for civil war".
The Muslim Brotherhood's spiritual leader Mohammed Badie said the army's removal of Mr Morsi was equivalent to destroying one of Islam's holiest sites, the Kaaba in Mecca.
"I swear by God that what Sisi did in Egypt is more criminal than if he had carried an axe and demolished the holy Kaaba stone by stone," Mr Badie said.
Some analysts say the military could be preparing to move against sit-ins by Mr Morsi's supporters, including one in front of the Rabaa al-Adawiya mosque in a Cairo suburb.
Mohammed Morsi narrowly won the presidential election in June 2012 to become Egypt's first democratically elected president, but his opponents accused him of trying to impose an Islamist agenda on the country.
Interim President Adly Mansour has set out a "roadmap" towards a revision of the constitution introduced by Mr Morsi and for fresh elections in early 2014, but this has has been rejected by the Muslim Brotherhood.
Hisham Qandil, who was prime minister under Mr Morsi proposed his own roadmap on Thursday, involving:
- the release of those detained by the army since Mr Morsi's removal
- an independent investigation into the deaths of at least 51 people at the Presidential Guards HQ earlier this month
- a delegation to be allowed to visit Mr Morsi to check on his health
- a halt to protest marches, with both sides agreeing to hold rallies only in specific locations
There has been no official response to Mr Qandil's suggestions, and military spokesmen have previously given the Muslim Brotherhood a deadline of Saturday to join the official process.
In a statement on Thursday, Ban Ki-moon called on the Egyptian military to free Mr Morsi and other members of the Muslim Brotherhood "or have their cases reviewed transparently without delay".