Security forces arrested the spiritual leader of the Muslim Brotherhood on Monday night, in an escalating showdown with the influential Islamist movement that has led to the ouster of Egypt’s first democratically elected president and some of the bloodiest urban violence in its modern history.

Mohammed Badie, a white-bearded professor, was shown on state television being whisked away to prison in a car, sitting next to a security officer in a bulletproof vest. His arrest, as well as those of other Muslim Brotherhood leaders, had been ordered after last month’s coup.

Badie’s detention was the latest in a rapidly unfolding series of events that seemed certain to outrage beleaguered Brotherhood supporters and intensify the crisis in the Arab world’s most populous nation.

Earlier Monday, an Egyptian court granted bond to the country’s former autocratic ruler, Hosni Mubarak, raising the prospect that he could be released from jail within days. Mubarak, 85, has been in poor health, and he still faces a host of legal problems, including a new trial related to the deaths of protesters in the 2011 revolt that ended his three-decade rule as president.

But his release would heighten suspicions that his former military-­backed regime has returned to power after the armed forces deposed Mohamed Morsi, the Islamist president, on July 3.

Morsi’s sympathizers were already furious about the killing a day earlier of 36 detainees apprehended during the recent crackdown. They accused Egyptian authorities of committing a massacre. The government said the prisoners had died in an attempted prison break.

For government supporters, meanwhile, a bloody attack Monday on police recruits in the Sinai Peninsula bolstered their argument that the Egyptian authorities are fighting terrorism. Unidentified gunmen killed 25 recruits traveling on a bus in the area, where Islamist militants have stepped up attacks since Morsi’s ouster.

Nearly 1,000 civilians and dozens of members of the security forces have died since Wednesday, when security forces raided two Islamist protest camps in Cairo in what Human Rights Watch on Monday called “the most serious incident of mass unlawful killings in modern Egyptian history.”

Neither side shows signs of backing down. Pro-Morsi demonstrators have marched in several areas in defiance of the 7 p.m. national curfew. Those daily protests seemed likely to intensify after the detention of Badie in an apartment in Nasr City, a Brotherhood stronghold in Cairo. He is accused of inciting violence.

For its part, the Egyptian government has been considering banning the Brotherhood. The State Department on Monday cautioned against such a move, saying Egypt needs an inclusive political process to emerge from the crisis.

A boost for Mubarak

Mubarak’s legal victory on Monday came in a case alleging that he and others misused funds allocated for presidential palaces. He was granted bond pending trial, under laws limiting the length of pretrial detention, court officials said. He has been held since 2011.

Mubarak is still being detained on another corruption charge, but his attorney said that case would be resolved within 48 hours. “He should be freed by the end of the week,” the attorney, Fareed el-Deeb, told the Reuters news agency.

During his detention, Mubarak has spent long stretches of time in the hospital, but he was moved back to prison in April after his health improved.

Hassan Abu Taleb, an analyst with Cairo’s al-Ahram Center for Political and Strategic Studies, said that the ruling appeared to be based on technical grounds but that the Brotherhood would “wage a media campaign” to link it to the coup against Morsi.

“People will look at this as the biggest symbol of the former regime walking free. This could change local dynamics, make things more tense for the new government,” he said in an interview.

Morsi and other Brotherhood activists suffered years of repression under Mubarak. On Monday, authorities announced that Morsi, who is being held in a secret location, is under investigation on charges that include taking part in the detention, torture and murder of citizens. The announcement gives authorities the legal basis to detain him for a longer period.

Earlier in the day, opponents of the military-backed interim government said at a news conference that they had asked Egypt’s top prosecutor to form an independent committee to investigate the deaths of the 36 prisoners on Sunday.

Mostafa Azab, the spokesman for a legal committee set up to defend the detainees, said authorities had provided sharply varying accounts of how they had died, saying at one point that they had rioted at Abu Zaabal prison north of Cairo but later reporting that assailants in a vehicle had tried to free them. The government has said that the prisoners suffocated when tear gas was used to control an escape.

“The MOI have three contradictory stories, and none of them make sense,” Azab said, referring to the Ministry of the Interior. He reported that some of the bodies bore signs of torture but said the Zeinhom morgue in Cairo refused to release them unless families signed certificates saying that the victims had died of asphyxiation.

‘Suspicious deaths’

The allegations are especially potent because human rights groups have documented the shooting deaths of scores of Egyptians in prisons during and after the uprising against Mubarak in 2011.

On Monday, morgue employees prevented most journalists from entering the downtown facility or speaking to medical officials there. Britain’s Daily Telegraph newspaper, whose reporter managed to enter the morgue, quoted officials there as saying that at least five of the dead had bullet wounds to the head or chest.

Outside the facility, on a garbage-­strewn patio buzzing with flies where a white-
shrouded body lay in an open coffin, Sayed Mohammed said he was waiting for a friend who was inside trying to attend to the body of his brother. Mohammed said the dead man was 50-year-old Abdelmoneim Muhammed Mostafa, a doctor who he said had been detained at a checkpoint on Wednesday.

Officials “said he died of asphyxiation, but his brother saw him and says he was shot,” Mohammed said.

Priyanka Motaparthy, a researcher with Human Rights Watch in Cairo, said the group was studying photos of the corpses taken by their relatives but had not yet determined whether torture had occurred.

In Washington, State Department spokeswoman Jen Psaki said the U.S. government was “deeply troubled by the suspicious deaths” of the prisoners.

An employee at the Interior Ministry media center said Monday that there were no updates since an earlier report saying that the detainees had died during an escape attempt while being transferred to the prison. He said he had no information about the morgue requiring families to sign documents saying the victims had died of asphyxiation. He spoke on the condition of anonymity, as is customary for the center’s employees.

Violence in the Sinai

The attack Monday on police recruits in the Sinai Peninsula was one of the deadliest in decades in the volatile territory that borders Israel.

The Egyptian Interior Ministry said the recruits were returning from leave to their jobs in the border town of Rafah when the gunmen opened fire. Gruesome photos of the victims posted on the Internet showed them lying in a row along the side of the road, dressed in casual clothes, most of them facing down. Some had their hands bound behind their backs.

The militants are relatively few in number, with little organization or command structure, according to local residents. But since the military removed Morsi, the fighters have carried out dozens of attacks on military and police checkpoints and bases in the Sinai, raising fears of a budding insurgency.

Abigail Hauslohner, Lara El Gibaly and Amer Shakhatreh in Egypt and Anne Gearan and Ernesto Londoño in Washington contributed to this report.