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

The Islamic militants Hamas, which rule Gaza, said Israeli undercover forces entered the territory in a civilian vehicle late 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.

Prime Minister Benjamin Netanyahu, left, and his wife Sara, with Canadian Prime Minister Justin Trudeau, right, in Paris on Sunday. Francois Mori / AP

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 2 miles into southeastern 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 defense 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."

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 I.

The mother of Nour Baraka, a commander for Hamas' armed wing, reacts at the morgue where his body was transported. Said Khatib / AFP - Getty Images

In a tweet after his arrival back home, Netanyahu praised the slain 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 percent unemployment and chronic power outages, and prevents the vast majority of Gazans from traveling.

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.

Israel says it is defending its border against militant infiltrations, but its army has come under international criticism because of the large number of unarmed protesters who have been shot

Last week, Israel allowed Qatar to deliver $15 million in aid to Gaza's cash-strapped Hamas rulers. Hamas responded by lowering the intensity of the border protest last Friday.

On Sunday, Netanyahu defended his decision to allow through the Qatari cash to Gaza as a way to avert an "unnecessary war," maintain quiet for residents of southern Israel and prevent a humanitarian catastrophe in the impoverished Gaza Strip.