Admiral Mohab Mamish confirmed that “a terrorist” had launched the attack against a Panamanian-flagged ship, adding in a statement that “the attempt failed completely and there was no damage to the ship or the containers it carried”.
The statement gave no details of the nature of the attempt at 1230 GMT Saturday, but sources said they heard loud explosions from the container ship which had been passing through the canal.
The Egyptian army ordered heightened security measures at the strategic sea route.
The Suez Canal dealt with a normal volume of 45 ships on Saturday with another 55 expected to pass through on Sunday.
The army recently launched a major operation in the North Sinai peninsula, around the canal, where several Islamist extremist groups operate.
On Saturday an Al-Qaeda front group based in Iraq and Syria called on Egyptians to take up arms against their country’s military.
The Islamic State of Iraq and the Levant (ISIS) also dismissed the Muslim Brotherhood, the party of ousted Egyptian president Mohamed Morsi, as “evil” for supporting democracy and seeking to win power through elections.
The security situation in the Sinai Peninsula, which borders Gaza and Israel, has deteriorated since 2011, when president Hosni Mubarak was overthrown.
But it became significantly worse after the army ousted Morsi on July 3, with attacks by militants targeting police and military installations.
At nearly 200 kilometres (125 miles) long, the Suez canal is owned by Egypt but governed by an international treaty that guarantees free navigation.
It provides a vital link between the Red Sea and the Mediterranean.
The US military enjoys special privileges due to its long-running alliance with Egypt, allowing American naval ships to jump the queue of vessels to transit the canal.
The US Navy has deployed five destroyers to the eastern Mediterranean, a defence official told AFP on Thursday, as expectations grow of an imminent strike on Syria.
Meanwhile the official Mena news agency reported the arrest of
Adel Mohammed Ibrahim, convicted in absentia and sentenced to death for killing 25 police officers in the worst attack of its kind in years on the peninsula.
He was arrested with other “terrorists” in the regional capital al-Arish, Mena reported, adding that the arrested man admitted his involvement to security officers.
The August attack raised fears of a return to the wave of deadly Islamist violence that swept Egypt in the 1990s.