GAZA CITY - An Israeli raid to destroy a Gaza tunnel ignited clashes in which tank fire killed four Hamas commanders and five Israeli soldiers were wounded, officials from both sides said Friday.

In one of the deadliest flareups in Gaza since an October 2012 war, Israeli warplanes carried out an air strike after Palestinian fighters lobbed between one and three mortar shells into southern Israel, though neither attack caused any further casualties.

Gaza’s Hamas rulers are under increased pressure from both Israel and Egypt, which has destroyed hundreds of similar tunnels in the south of the besieged Palestinian enclave used to bring in fuel and other goods.

The closure of the Egypt tunnels forced authorities to shut down Gaza’s sole electricity plant early Friday, causing widespread power outages, the Hamas movement said.

The Israeli military said the fighting erupted late Thursday night when an explosive device went off as troops were clearing a tunnel from Gaza into Israel, allegedly to be used as a springboard for attacks. The blast wounded five soldiers, the army said.

Palestinian officials said four local commanders of Hamas’s military wing, the Ezzedine al-Qassam Brigades, were killed by tank fire. Rabieh Barikeh was killed instantly and Khaled Abu Bakr died of his wounds during the night, according to the officials, who said the commanders were carrying out surveillance along the frontier east of the town of Khan Yunis when they came under fire. The bodies of Mohammed al-Qassas and Mohammed Daoud were discovered later. Barikeh’s funeral on Friday afternoon, the first of the four that were to take place during the day, was attended by some 2,000 Hamas supporters holding up the movement’s flag and shouting “revenge against Israel.”

During the exchange, Hamas TV said, three mortar shells were fired from Gaza into southern Israel, but the Israeli army reported only one, which it said fell in an open field, causing no casualties or damage.

The military said the initial operation was aimed at dismantling a section of a tunnel into Israel uncovered last month.  “This mission was imperative due to the potential to utilise the terror tunnel for future attacks against Israeli civilians,” army spokesman Peter Lerner said.

The Qassam Brigades said last month that it had dug the tunnel as part of a plan to seize Israeli soldiers and hold them in exchange for imprisoned Palestinians.