Masked gunmen have killed 16 Egyptian soldiers at a checkpoint along the border with Gaza and Israel, the first such attack on troops.
The attackers then drove off, crashing into Israel, officials said. Egypt blamed Islamist militants from Gaza and Egypt's troubled Sinai Peninsula for Sunday's attack and President Mohammed Morsi said they "will pay dearly".
The Israeli military said the attack was part of a plot to kidnap an Israeli soldier, and two vehicles commandeered by the attackers crashed into Israel, where one blew up.
In a statement, Israel's defence minister Ehud Barak said Israel's military and the internal security agency "thwarted an attack that could have injured many. The militants' attack methods again raise the need for determined Egyptian action to enforce security and prevent terror in the Sinai".
The attack took place around sunset in the Egyptian border town of Rafah, when the troops were having the traditional meal at the end of the daily fast during the Islamic holy month of Ramadan.
Egyptian state TV said the attack on the checkpoint was carried out by Islamist militants. The report said 16 troops were killed in the attack co-ordinated between Palestinians who entered Egypt from Gaza and Egyptians in Sinai. Emergency services official Ahmed el-Ansari told Egypt's news agency that seven were wounded by gunfire.
President Morsi convened an emergency meeting with military and security leaders following the attack. In a statement, he declared: "Those who carried out this crime will pay dearly."
In an interview on Egyptian state TV Mr Morsi said: "There is no room for appeasing this treason, this aggression and criminality. The troops will totally control Sinai."
Israel's military spokesman said intelligence services had reports of an impending attack from Egypt and were ready to thwart it.
Brig Gen Yoav Mordechai said militants blew up one of the vehicles to enter Israel. But he said Israeli intelligence services had information about an impending infiltration and sent aircraft to strike a second car the militants had seized from the Egyptian forces. He told Army Radio, "We were prepared for it, therefore there was a hit."