The gunmen crossed in a mountainous area along the desert frontier where Israel is working to complete a fence, said Capt. Eytan Buchman, an army spokesman.
The steel barrier was intended to keep out illegal African migrants who have streamed into Israel from Sinai in growing numbers in recent years, but it is increasingly seen also as a bulwark against armed infiltrators.
Israeli soldiers who were securing the construction zone were fired on from about 100 yards away as they fetched water for a group of migrants who had reached the border from the Egyptian side, the chief of the army’s southern command, Maj. Gen. Tal Russo, told reporters.
An additional Israeli force sent to the scene engaged the gunmen, and during the exchange of fire an explosive belt worn by one attacker detonated, Buchman said. He said the clash unfolded at Mount Harif, about halfway between the Gaza Strip and the southern Israeli resort city of Eilat.
The army said the gunmen wore camouflage uniforms and ammunition vests and had stockpiled three launchers for rocket-propelled grenades, an explosive belt and a machine gun in a nearby pit, suggesting that they had planned a larger assault.
Russo said the attack was “apparently by global jihad,” a reference to al-Qaeda-inspired groups who are believed to be operating in Sinai and have posted videos taking responsibility for previous attacks.
“We will reach anyone who dispatched this attack, and we will settle accounts with him,” Russo said.
An attack by militants last month on an Egyptian base near the border town of Rafah left 16 soldiers dead, prompting a broad crackdown by reinforced Egyptian units dispatched to Sinai. In that attack, the militants commandeered two vehicles and burst across the border with Israel before being stopped by Israeli forces.
In June, militants who crossed into Israel attacked vehicles carrying a crew working on the border fence, killing one worker. In August 2011, an attack on a border road north of Eilat left eight Israelis dead.
Islamist militants and local Bedouin tribesmen have also assaulted Egyptian police stations in Sinai and blown up pipelines carrying natural gas to Israel.