Israel's military says its forces opened fire on four Palestinian militants near the Gaza border fence, killing the men.
The men were armed with assault rifles, anti-tank missiles and hand grenades, one of which was hurled at the Israeli troops, the military said on Twitter.
"The soldiers opened fire after one of the terrorists crossed the border and killed them."
There was no immediate comment from Palestinian officials in Gaza or from militant groups in the territory.
Gaza is ruled by the Islamist group Hamas, which has fought three wars with Israel over the past decade.
Israel pulled its troops and settlers from the territory in 2005 but keeps the enclave under a blockade, citing security concerns. Tensions along the border are high with frequent fatalities.