An attempt by heavily armed Palestinian militants in Gaza to enter Israel was thwarted early Saturday, the military said.

All four armed men were shot dead after one crossed the border and fired at troops and tossed a grenade, according to an army statement, which said the militants were armed with AK-47 assault rifles, hand grenades, and a rocket-propelled grenade launcher.

>> Read more: Netanyahu vows unprecedented response if Gaza flares up - but it's the last thing he wants | Analysis

Palestinian reports from Gaza identify the four militants as Abdullah Ismail Al-Hamaida, 21, Abdullah Ashraf al-Ghomri, 19, Ahmad Ayman al-Adeini, 20 and Abdallah al-Masri, 21, all of Deir al-Balah in the central Gaza Strip.

According to reports, the four belonged to an extremist Salafi Muslim sect that underwent weapons training as former members of Hamas' military wing, the Al-Qassam Brigades. Reports say the four distanced themselves from Hamas a few months ago due to their Salafism.

Open gallery view The Gazan men who breached the border on Saturday morning Credit:

Israel Defense Forces Spokesman Brig. Gen. Ronen Manelis said that "a very large attack" had been prevented. The militants' remains are in Israeli custody, the army said.

Manelis further said that the incident was clearly an infiltration attempt by an organized cell, whose members were equpped with weapons and food. The military was still assessing whether the cell planned to target troops or civilians, he said.

Manelis denied Palestinian reports that said that the militants belonged to the Hamas unit responsible for averting infiltrations into Israel. "We hold Hamas responsible for everything that takes place in Gaza," he said, including preventing such crossings.

Hamas spokesman Abdulatif al-Qanua, meanwhile, said that Israel "Committed a crime against a group of young men furious because of the organized terror [of Israel] against the Palestinian nation and the seige of Gaza," and added that Israel is responsible for the anger and stress of Palestinians in Gaza.

It was not immediately clear who was behind the infiltration attempt, with defense sources saying that the number of people and weapons involved suggested it was not spontaneously organized, but rather planned by a group in Gaza opposed to the policies of the enclave's rulers. The sources added that it was unlikely that an attack with this level of preparation could have been planned without Hamas or Islamic Jihad's knowledge.

Hamas Spokesman Fawzi Barhoum said that "A continuation of the blockade on the Gaza Strip will bring about an explosion in the region, and therefore we must remove the blockade and end the suffering of Gaza residents."

An Islamic Jihad statement said that "On the eve of Eid al-Adha, four martyrs sacrificed their lives in the Gaza Strip. Israeli terror will not calm the overpowering fury in the souls of the free men." It went on to say that Israeli actions, such as offenses at the Al-Aqsa mosque, the blockade of Gaza, the destruction of Palestinian homes, arrests and others, "are elements for an explosion that will come so long as Israel's policy continues, and it is reponsible for these crimes."

In the hours preceding the military's announcement, Palestinian reports on social media said Israeli aircraft had struck a Hamas observation post in the central Gaza Strip, and that gunfire could be heard on the border at the same time. Gazans reported that Israeli aircraft were still encircling the skies hours later.

Meanwhile, Palestinian media outlets reported that Israeli troops entered the West Bank town of Bayt Kahil north of Hebron, conducting searches of homes. There were also reports that Israeli forces blocked off traffic and arrested three men and a woman.

Last week, the military said three soldiers were shot and wounded by Hani Abu Salah, a Palestinian who infiltrated the Gaza border fence east of Khan Yunis. According to the army, Abu Salah was subsequently killed by Israeli fire.

Manelis said at the time that Abu Salah was wearing a Hamas uniform and armed with an AK-47 and grenades. Preliminary investigations assessed that the suspect acted independently.

Earlier this week, the Shin Bet security agency said it had uncovered a Hamas cell in Hebron whose members were plotting to carry out attacks in Jerusalem. The suspects, who received orders from Hamas in the Gaza Strip, were arrested in June in a joint operation with the Israeli army and police, the Shin Bet said.

Also this week, a 19-year-old Israeli soldier and yeshiva student was stabbed to death in the West Bank settlement bloc of Gush Etzion by an unknown assailant.