Egypt crisis: Police arrest Muslim Brotherhood's spiritual leader Mohamed Badie in Cairo

Mr Badie and his deputy Khairat el-Shater, go on trial later this month for their alleged role in the killing of eight protesters in June

Police in Egypt have detained the supreme leader of the Muslim Brotherhood, according to security officials and state television.

Mohamed Badie was taken into custody after he was found in an apartment in the eastern Cairo district of Nasr City, according to security officials and state television.

The apartment was very close to where supporters of the ousted president Mohamed Morsi held a six-week sit-in protest that was cleared by officers last Wednesday.

Badie and his influential deputy Khairat el-Shater, who is also in custody, will go on trial later this month for their alleged role in the killing of eight protesters outside the Brotherhood's Cairo headquarters in June.

His arrest is another step in the authorities’ crackdown on the Brotherhood’s leaders and officials, detaining scores of them across the country.

The arrest came the day after a bloody attack which saw 25 policeman killed in an ambush by suspected militants in the Sinai Peninsula.

It also follows a court ruling suggesting that the jailed former president Hosni Mubarak could be released later this week. The autocrat’s release could cause further unrest in the divided country after Morsi, the country’s first democratically elected president and Mubarak’s successor, was removed in a military coup  on 3 July.

A state of emergency is in force amid the turmoil, with almost 900 people, including more than 100 police and soldiers reportedly killed since Wednesday.

The attack on a police convoy near the town of Rafah on the border with Gaza is thought to be one of the deadliest on state security forces in recent years.

On Monday night the 25 murdered policemen were given a funeral with full military honours. The men’s coffins were draped in red, white and black Egyptian flags and carried jointly by soldiers and police officers. Egypt’s interim President Adly Mansour has declared a nationwide state of mourning to mark the men’s deaths.

While no group has claimed responsibility for the attack, the strategically important area is home to a number of radical militant groups, some with links to al-Qa'ida.

The United States condemned the slaying of the police officers, repeating its commitment to help Egypt combat terrorism in Sinai.

Mubarak, 85, has been in detention since April 2011, two months after he was ousted in a revolution against his rule.

He was  sentenced to life in prison last year for failing to stop the killing of some 900 protesters during the 18-day uprising.

His sentence was overturned on appeal and he is now being retried, along with his security chief and six senior police commanders.

Two judicial officials said Mubarak could walk free as early as this week, after a criminal court ordered his release in a corruption case. The former leader and his two sons were accused of embezzling funds in order to maintain presidential palaces. His sons will be kept in custody.

Freeing Mubarak during one of the worst bouts of turmoil since he was ousted would be a huge risk for the military-backed government.

It could lend credibility to allegations the mass protests that preceded the 3 July coup that toppled Egypt's first democratically elected leader were the work of Mubarak-era figures searching for a way to reinstate the former regime.

Last week, the military raided two pro-Morsi protest camps in Cairo, killing hundreds of people and triggering a wave of violence leaving at least 1,000 people dead.

Human Rights Watch has accused Egyptian security forces of using excessive force when they moved to clear the larger of the two camps.

The New York-based group said the assault amounted to the “most serious incident of mass unlawful killings in modern Egyptian history”.

Morsi has been held in an undisclosed location since he was deposed.

On Monday prosecutors ordered his detention for 15 days in connection with allegations that he conspired to kill and torture protesters during mass demonstrations by the opposition outside his presidential palace in December 2012.