One soldier was seriously wounded and another was in moderate condition Friday after an IDF operation Thursday night to destroy part of a tunnel, east of Khan Younis just inside the Gaza Strip, was targeted by Hamas. A total of five soldiers were injured when an explosive device planted by Hamas detonated, the IDF said in a statement.

Four members of Hamas’s armed wing, Izz ad-Din al-Qassam, were killed in the clash, including three of the Islamist group’s tunnel and rocket experts, an Israeli military source said.

The IDF had braced for the possibility of soldiers being targeted in the operation to destroy the tunnel, including possible kidnap attempts, the military source said. The explosive device, planted by Hamas in the weeks since the tunnel was first detected and revealed by the IDF, may have been detonated by a drill used by one of the IDF troops in the operation, the source added.

Senior members of the IDF’s Combat Engineering corps were involved in the operation, and were among those injured, the source added.

The Israeli Air Force later targeted another tunnel in the southern Gaza Strip, confirming a direct hit.

All five soldiers were evacuated via helicopter to Soroka Medical Center in Beersheba.

Hamas-run TV in Gaza said that its forces laid out a “sophisticated” improvised explosive device (IED) for the soldiers, adding that this was a “slap in the face to those who claim the resistance is dead.” A Hamas spokesman threatened that the Strip would be “a graveyard for the invaders.”

The IDF’s Southern Command chief, Maj. Gen. Sami Turgeman, said the tunnel dug under the border was a terrorist initiative, and that Israel crossed into Gaza to eliminate the threat it posed. “Quiet will be met with quiet,” he said, but if Hamas continued instigating terrorism, it would be met with a forceful IDF response.

A view of a tunnel dug by Palestinians beneath the border between the Gaza Strip and Israel and recently uncovered by Israeli troops, on October 13, 2013. (photo credit: David Buimovitch/Flash90)

A view of a tunnel dug by Palestinians beneath the border between the Gaza Strip and Israel and recently uncovered by Israeli troops, on October 13, 2013. (photo credit: David Buimovitch/Flash90)

The soldiers were preparing to blow up a segment of a major tunnel that was exposed in October, the IDF said. They were within 100 meters of the Kissufim checkpoint between Israel and the Strip, on the Gazan side.

The tunnel — 18 meters underground, 1.7 km long and particularly wide, according to officials — started in Abbasan al-Saghira, a farming village near Khan Younis, and terminated inside Israel, about three kilometers from Kibbutz Ein Hashlosha, in the western Negev.

“In its offensive actions against Israel, Hamas has breached the arrangements reached following Operation Pillar of Defense,” the IDF said in a statement Friday.

Palestinians gather around the body of a Hamas terrorist at a hospital in Khan Younis in the southern Gaza Strip October 31, 2013.  (Photo credit: Abed Rahim Khatib/Flash 90

Palestinians gather around the body of a Hamas terrorist at a hospital in Khan Younis in the southern Gaza Strip October 31, 2013. (Photo credit: Abed Rahim Khatib/Flash 90

The tunnel was likely intended to facilitate a terror attack or kidnapping attempts inside Israel.

The mission to destroy the tunnel Thursday “was imperative due to the potential to utilize the terror tunnel for future attacks against Israeli civilians,” IDF Spokesman Lt. Col. Peter Lerner said. “This tunnel, similar to the one used to kill two IDF soldiers and kidnap Gilad Shalit in 2006, was built for this heinous purpose. Hamas, as the authority in the Gaza Strip, is accountable and responsible for all activities aimed at harming Israeli civilians and IDF soldiers.”

Earlier Thursday, residents of Israeli communities along the Gaza border bade a reluctant farewell to IDF troops who were pulled out of guard duty there.

Soldiers will no longer man guard posts in 13 communities that abut the border, with security duties henceforth to fall on the residents themselves. Local residents said that the constant presence of soldiers had been reassuring with the Gaza Strip so close to their homes.

Community leaders had requested an urgent meeting with Defense Minister Moshe Ya’alon, but were yet to receive a response as of Thursday, Yedioth Ahronoth reported.

Alon Schuster, head of the Sha’ar Hanegev Regional Council, reacted to the IDF withdrawal, saying its timing was “most unfortunate” in light of Thursday night’s events in Gaza. “The facts speak for themselves,” he added.

On Wednesday, dozens of local residents held a demonstration in the Netiv Ha’asarah community against the pullout, on which the IDF’s Operations Directorate decided in September.

Communities near the border with Gaza have sustained frequent rocket and mortar attacks over the past decade. Those attacks have diminished significantly since Israel’s Operation Pillar of Defense, an 8-day military offensive that sought to curb rocket fire from the Strip last November.

Times of Israel staff contributed to this report.