Egypt's army vowed Monday to "avenge" the killing of 16 guards by gunmen near the Israeli border, as President Mohamed Morsi ordered security forces to take full control of the increasingly lawless Sinai Peninsula on the frontier.
Morsi said he had given "clear instructions" that Egypt must take "full control of the Sinai."
An interior ministry team has been sent to the site to investigate the attack, the ministry said.
Morsi, who only took the oath of office on June 30 to become Egypt's first freely elected leader and its first head of state since Mubarak's overthrow, said those who committed the "cowardly" attack and those who worked with them would pay dearly.
"Those responsible for this crime will be hunted down and arrested," he said.
"Everybody will see that the Egyptian military and police forces can get these criminals wherever they are," he said.
The president declared three days of mourning to honour the "martyrs and wounded in the same way as martyrs and wounded of the January 25 revolution" that toppled Mubarak, according to state media.
In Sunday's attack, gunmen in Bedouin attire drove up to a border post and opened fire before crossing into the Jewish state in an armoured vehicle, Egyptian officials said. Israel said five gunmen were killed on its side.
The 1979 peace treaty between Egypt and Israel, under which Israel withdrew from the Sinai which it had occupied in the 1967 Middle East war, set strict limits on Egyptian troop numbers in the peninsula.
But Israel has complained of growing lawlessness on its southern border since the overthrow of veteran strongman Hosni Mubarak early last year and called for action by Cairo.
"We swear in the name of God to avenge them," the army said.
"Egyptians will not have to wait long before they see a reaction to this attack by terrorists," it said in a statement carried by the official MENA news agency.
"Anyone liaising with these groups that have attacked our troops in the Sinai in recent months will pay dearly, be it inside Egypt or abroad," it added.
Israel said two armoured vehicles were seized, one of which exploded by itself and the other of which was destroyed by a helicopter.
"The bodies of the five gunmen have been found by the Israeli army," an Israeli military spokesman said, but did not give details.
Israeli military spokesman Yoav Mordechai told army radio: "We were ready because we had previous information from Shin Bet (security service) and from military intelligence services, which allowed us to thwart a bloody attack."
The armoured vehicle that crossed the border "fired in every direction after entering Israeli territory before being attacked by tanks and from the air," said Mordechai.
The gunmen were "members of the global jihad based in Sinai, which has become a hothouse for world terrorism because of the weak control exercised" by Egypt, he added.
Israeli Prime Minister Benjamin Netanyahu expressed "regret" over the deaths of the Egyptian guards in remarks during a visit with Defence Minister Ehud Barak to the site, his office said.
"I think it is clear that Israel and Egypt have a common interest in keeping the border between us peaceful," he added, going on to congratulate the Israeli military and security services for "preventing a very major attack" on Israelis.
Barak said the attempt was unlikely to be the last.
"I hope that this will be a wake-up call to the Egyptians regarding the need to be alert and effective on their side," his office quoted him as saying.
Israel's former ambassador to Egypt, Yitzhak Levanon, said the incident was an attack on "Egyptian institutions, as well as on President Mohamed Morsi, the army and the intelligence services."
The health ministry said after the attack that 16 soldiers and border guards had been killed, while a security official said another seven were wounded.
Israel's military said no Israeli soldiers or civilians were hurt.
Egypt's MENA news agency said the gunmen were "jihadists" who "infiltrated from Gaza through tunnels in collaboration with jihadist elements in the Al-Mahdiya and Gabal Halal areas" inside Egypt.
They "attacked a border post while the soldiers and officers were taking iftar," the meal that breaks the Ramadan fast, it added.
State television and MENA reported Egypt was closing its Rafah frontier crossing with Gaza "until further notice." Rafah is Gaza's only crossing that is not under Israeli control.
Some Egyptian newspapers blamed the attack on "terrorists" or "jihadist groups from Gaza and the Sinai."
But Gaza's Hamas rulers dismissed the idea that militants from inside the territory may have been involved.
Sinai-based Islamist militants are believed to have been responsible for rocket attacks against Israel.
Israel also accused them of having carried out a cross-border ambush last August that killed eight Israelis, and they have also been blamed for repeated bombings of a pipeline that exports gas to Israel and Jordan.
The Sinai is home to Egypt's Red Sea resorts, a source of lucrative tourist income, and is also where the country's Bedouin, long marginalised under the Mubarak regime, are based.
To stop any attacks and illegal cross-border activities Israel has speeded up construction of a wall fitted with an electronic alert system along its 240-kilometre (150-mile) border with Egypt.