Egypt's deposed president, Mohamed Morsi, is being detained for 15 days pending investigation on charges of conspiring with Hamas during the 2011 revolution that toppled Hosni Mubarak, according to the state news agency MENA.

The investigation includes claims that Morsi collaborated with the Palestinian group to carry out "anti-state acts," including attacks on police stations and prisons.

Morsi himself was detained in Wadi Natroun prison during the revolution; he escaped on January 30, 2011, along with dozens of other inmates, including numerous high-ranking members of the Muslim Brotherhood.

The complaint against Morsi accuses him of plotting with Hamas to organise his escape.

An Al Jazeera source in the prosecution confirmed the report on Friday.

This is Morsi's first formal detention since he was toppled in a military coup on July 3. He has been held by the army since then in an undisclosed location.

His 15-day detention can be extended as the inquiry continues.

The report came as supporters and opponents of Morsi prepared for mass national protests called for by the country's army chief, and later by members of the Muslim Brotherhood, in a struggle over the country's future.

The Muslim Brotherhood criticised the ruling and described it as a sign that Mubarak's regime is returning to power.

"The accusations read as if they're a retaliation from the old regime, signalling 'We're back in full force,'" said Brotherhood spokesman Gehad El-Haddad.

Hamas, the rulers of the Gaza strip, called the investigation a "dangerous development."

"It is based on the premise that the Hamas movement is hostile," Hamas spokesman Sami Abu Zuhri told the AFP news agency. "[It] confirms that the current powers in Egypt are giving up on national causes and even using these issues to deal with other parties - first among them the Palestinian cause."

Source: Al Jazeera and agencies