A Palestinian crossed into Israel from Gaza and shot at troops, setting off a firefight in which he was killed and three Israeli soldiers were wounded early Thursday, the army said.
An Israeli tank targeted a Hamas military post after the incident which began at around 2:00 am, Israel's military said.
It said an army officer was moderately wounded and two soldiers were lightly injured by gunfire from the Palestinian, who entered Israel from the border fence in the Khan Yunis area of the southern Gaza Strip.
Israel's military believes he was a member of the Islamist movement Hamas but had acted alone, said army spokesman Jonathan Conricus.
He was armed with a Kalashnikov rifle and grenades, according to Conricus.
He threw at least one grenade and was killed by Israeli soldiers who were scrambled to the area in response, Conricus said.
"Our current assumption is -- and this doesn't look likely to change -- is that he did not act, he was not sent, on an attack mission, but rather that he did this attempted attack on his own," the spokesman told journalists.
Hamas, which rules Gaza, did not give an immediate comment but a security source in the strip also said the gunman was a member of the movement.
There has been tension along the Gaza border since regular protests and clashes erupted there in March 2018.
At least 297 Palestinians have since been killed in Gaza or the border area by Israeli fire, the majority during demonstrations and clashes.
Seven Israelis have also been killed.
The protests have declined in intensity recently after a truce brokered by UN officials and Egypt. Under the truce, Israel agreed to take steps to ease aspects of its blockade on Gaza.
Israel and Hamas have fought three wars since 2008.