Benjamin Netanyahu has rushed back to Israel, hours after an army officer and seven Palestinians – including a local Hamas commander – were killed after an incursion by special forces into the Gaza Strip.

The Islamic militant Hamas, which rules Gaza, said Israeli undercover forces entered the territory in a civilian vehicle late on Sunday and exchanged fire with Hamas gunmen.

The clashes prompted Israeli airstrikes and a salvo of rocket fire from Gaza toward Israel.

An Israeli lieutenant colonel and several Hamas fighters were among those killed.

The cross-border fighting came just days after Israel and Hamas reached indirect deals, backed by Qatar and Egypt, to allow cash and fuel into Gaza.

It was not clear if the burst of violence would derail the arrangements which are aimed at preventing a further deterioration of conditions in Gaza, under blockade by Israel and Egypt since a 2007 Hamas takeover.

The Hamas military wing, Izzedine al-Qassam, said that in Sunday’s incursion, Israeli undercover forces drove about two miles into south-eastern Gaza and shot and killed Nour el-Deen Baraka, a mid-level commander in the town of Khan Younis.

Qassam members discovered the car and chased it, prompting Israeli airstrikes that killed several people, the group said.

The Israeli military said there had been an exchange of fire during an operation in Gaza, with troops withdrawing from the territory with the help of aircraft.

It said that militants then launched 17 rockets from Gaza toward Israeli communities, where school and train service was cancelled in response, and that it had reinforced troops and its aerial defence system along the border following the flare-up.

The military provided few details about the reason for the raid. The Israeli military chief, Lt. Gen Gadi Eisenkot said a “special force” carried out “a very meaningful operation to Israel’s security”, without elaborating.

Israeli military spokesman Lt Col Jonathan Conricus said the operation was “not intended to kill or abduct terrorists but to strengthen Israeli security”.

He said the force faced a “very complex battle” and was able to “ex-filtrate in its entirety”.

Prime Minister Mr Netanyahu returned to Israel on Monday morning, cutting short a trip to Paris where he was set to meet French President Emmanuel Macron after having participated in ceremonies marking 100 years since the end of World War One.

In a tweet after his arrival back home, Mr Netanyahu praised the dead officer, whose identity was being kept confidential, and said “our forces acted courageously”.

The overnight violence came after several months of confrontations along the Israel-Gaza perimeter fence.

Since late March, Hamas has been leading mass marches, with turnout driven by growing despair in Gaza, to try to break the border blockade.

The blockade has led to over 50% unemployment and chronic power outages, and prevents the vast majority of Gazans from travelling.

More than 170 demonstrators, most unarmed, have been killed by Israeli army fire in the confrontations in which some of the participants threw stones, burned tires or threw grenades toward Israeli forces.