Unnamed security officials told The Associated Press that crew members jumped off the ship to escape a fire on board, and that a number were injured by the smoke and flames.

Egypt’s military and security services have struggled to adapt as the pace of spectacular attacks has quickened in recent weeks. The militants have showed their continued ability to acquire advanced weapons, and experts say the sophistication of the most recent assaults may also be evidence that they have begun coordinating their tactics with Islamic State operatives.

The killing of the prosecutor, Hisham Barakat, in a neighborhood near the Cairo airport on June 29, was the first time the militants had assassinated a senior Egyptian government official. Two days later, jihadists in Sinai launched their most ambitious attack on the military, killing at least 21 soldiers while briefly occupying a town.

A car bomb in Cairo on Saturday killed one person and destroyed part of the Italian Consulate, in the first major bombing of a foreign diplomatic mission since the start of the insurgency.

As it has in the past, the government of President Abdel Fattah el-Sisi has responded to the attacks by stepping up its military operations in Sinai — an approach that critics say does little to alter fundamental problems with its counterinsurgency strategy.

The military said it killed more than 200 militants since the attack by Sinai Province in early July. But the offensive had also killed at least 16 civilians, deepening the sense of “collective punishment” that has hampered efforts by the military to win support among local residents, according to Sherif Mohy El Deen, a counterterrorism and human rights researcher at the Egyptian Initiative for Personal Rights in Cairo.

“Every day, you say you have eliminated the terrorists,” Mr. Mohy El Deen said, echoing the frequent government pronouncements. “But you have gone from targeting them to defending against them.”

On Thursday, in a sign the government was beginning to acknowledge flaws in its approach, the authorities announced the dismissal of the senior Interior Ministry official responsible for security in Cairo, according to Al-Ahram, a state newspaper.