Gunmen shot and killed a senior police official outside his home in a suburb of Egypt’s capital Tuesday in the latest insurgent attack on a law enforcement target.

Also Tuesday, deposed president Mohamed Morsi appeared in a Cairo court to face charges of conspiring with Palestinian and Lebanese militants to break out of prison during Egypt’s 2011 uprising.

Two gunmen on a motorcycle fatally shot police Gen. Mohamed el-Saeed in the Giza district of greater Cairo, the Interior Ministry said. Saeed was head of the ministry's technical department, an administrative post.

As a senior aide to the interior minister, he would have been considered a symbol of the security hierarchy that has conducted a bloody crackdown on Islamists and other opposition members in recent months and that increasingly has been the target of a militant insurgency. Late Tuesday, the Sinai-based jihadist group Ansar Bayt al-Maqdis claimed responsibility for the killing, calling Saeed a “deviant criminal” and warning other top security officials that they might face a similar fate.

The militant organization has stepped up attacks on Egyptian security forces since Morsi, Egypt’s first democratically elected leader, was ousted in a coup last summer, and it is now staging regular, deadly assaults in the capital.

(Timeline: Some of the most recent attacks carried out by Ansar Bayt al-Maqdis)

“This morning, terrorists murdered General Mohamed Saeed . . . a faithful civil servant,” presidential spokesman Ehab Badawy said. “He was shot dead in cold blood in front of his home.”

Interior Minister Mohamed Ibrahim, Saeed’s boss, survived an assassination attempt by a suicide bomber in September.

The government’s crackdown on Islamist groups began after a military coup in July that removed Morsi from power. Since then, most leaders of the Muslim Brotherhood, which backed Morsi, have been arrested, and the military-supported interim government has declared the Brotherhood a terrorist organization.

Morsi, wearing a white prison uniform and confined to a glass-and-metal cage in the courtroom, shouted at the trial judges during his appearance Tuesday and questioned the legitimacy of the proceedings, according to footage aired on state television.

“Who are you?” Morsi yelled. “Don’t you know who I am?”

Judge Shabaan el-Shami responded: “I am the head of Egypt’s criminal court.”

The court appearance was only the second time Morsi has been seen in public since he was ousted. He appeared with senior leaders of the Muslim Brotherhood, who are charged with assisting jailbreaks on Jan. 30, 2011, at the height of the 18-day popular uprising that forced former strongman Hosni Mubarak to step down.

At the time, Morsi was a political prisoner at the Wadi el-Natroun prison, having been arrested by Mubarak’s police in the early days of the revolt.

Morsi and the other defendants are charged with working with hundreds of militants from Hamas, an armed Palestinian group, and the Lebanon-based group Hezbollah to steal weapons from security forces and free Islamists and other prisoners from two jails outside Cairo.

In all, about 20,000 prisoners escaped from prisons nationwide in 2011, according to prosecutors. But there is scant evidence that they relied on the elaborate operation described by prosecutors.

Instead, widespread desertions by security forces and prison guards led to a breakdown of law and order during the uprising and to the release or escape of thousands of criminals and other prisoners, according to witnesses, activists and officials interviewed at the time.

Some analysts and civil rights activists accused the Interior Ministry of coordinating the chaos as a last-ditch effort to turn public opinion against the uprising.

In the indictment, prosecutors alleged that Hamas and Hezbollah operatives controlled more than 30 miles of Egypt’s eastern border with Israel and the Gaza Strip for several days in 2011, allowing militants easy access into Egypt.

But Egypt’s border with the Gaza Strip is just over seven miles long, and Israel never relinquished control over its heavily fortified and closely monitored border area.

One of the most high-profile Brotherhood leaders on trial, Mohamed Beltagy, looked haggard after five months in prison, according to the TV footage. The Brotherhood-led Anti-Coup Alliance, an Islamist coalition, said last month that Beltagy had started a hunger strike to protest dire prison conditions.

On Monday, Egypt’s powerful Supreme Council of the Armed Forces, a group of top military generals, announced its endorsement of Defense Minister Abdel Fatah al-Sissi if he decides to run for president.

Sissi, a general who has led the crackdown on opposition groups and is well regarded by much of the public, is expected to announce his candidacy within days.