A Sinai-based militant group said on Thursday it had beheaded four Egyptians, accusing them of providing Israel with intelligence for an airstrike that killed three of its fighters.

Four headless corpses were found in the Sinai Peninsula earlier this month, security sources said — the first time that any decapitations had been made public in Egypt.

The men had been abducted by gunmen two days earlier while driving in the town of Sheikh Zuwaid, which is just a few kilometres from the Gaza Strip.

In a video released on Twitter, Egypt's most dangerous militant group, Ansar Bayt al-Maqdis, said the four men had been spying for Israel's Mossad spy agency.

Armed men in black masks stood over the kneeling captives as one of the militants read out a statement. Minutes later, the four men had their heads cuts off.

The decapitated men had been abducted by gunmen two days earlier while driving in the town of Sheikh Zuwaid, which is just a few kilometres from the Gaza Strip. (Google)

The filmed killings was reminiscent of images posted on the Internet by Islamic State in Iraq and Syria (ISIS), which has seized large parts of Iraq and Syria, suggesting Ansar Bayt al-Maqdis might have been inspired by the group, notorious for beheadings and executions.

In Gaza itself, meanwhile, an open-ended ceasefire in the Gaza war held on Thursday, as Prime Minister Benjamin Netanyahu faced strong criticism in Israel over a costly conflict with Palestinian militants in which no clear victor has emerged.

The Egyptian-mediated ceasefire agreement that took effect on Tuesday evening, called for an indefinite halt to hostilities, the immediate opening of Gaza's blockaded crossings with Israel and Egypt, and a widening of the territory's fishing zone in the Mediterranean.

Under a second stage of the truce that would begin a month later, Israel and the Palestinians would discuss construction of a Gaza sea port and Israel's release of Hamas prisoners in the occupied West Bank, possibly in a trade for the remains of two Israeli soldiers believed held by Hamas, the officials said.

Palestinian health officials say 2,139 people, most of them civilians, including more than 490 children, have been killed in the enclave since July 8, when Israel launched an offensive with the declared aim of ending rocket salvoes.

Israel's death toll stood at 64 soldiers and six civilians.

The Sinai militants are not believed to be officially linked to Islamic State insurgents, but Egyptian intelligence officials say the group has influenced Egyptian militants who are based just over the border with Libya.

The officials say the Libya-based fighters have also established contacts with Ansar Bayt al-Maqdis.

Though the four dead men were civilians, security sources had said initially that they might have been targeted for their perceived allegiance to the police and army.

In the video, Ansar Bayt al-Maqdis presented what it said were confessions by the men. Two of them said they had spent time in Israeli jails for smuggling. The other two said Mossad had paid them for information.

The group said the men provided intelligence used in an airstrike on July 23 in northern Sinai that killed three of its fighters. At the time, the Egyptian army said no Israeli aircraft or drones had crossed into Egyptian airspace.

Militants in the Sinai have stepped up attacks on policemen and soldiers since then-army chief Abdel Fattah al-Sisi toppled President Mohamed Mursi of the Muslim Brotherhood in July 2013.

The attacks initially targeted security forces in Sinai — a remote but strategic part of Egypt located between Israel, the Gaza Strip and the Suez Canal — but they have since extended their reach, with bombings on the mainland.

The violence has hurt tourism, a pillar of the economy.