An explosion targeted an Israeli military vehicle on the Israel-Gaza border and Israeli troops then fired into Gaza, killing two civilians and wounding at least 25 others, Palestinian officials and witnesses said.
Ayman al-Sahbani, a doctor at Gaza's Shifa hospital, said all the casualties were civilians and among the wounded were children.
Witnesses said that following the large explosion, Israel retaliated with tank and machine gun fire towards a residential area in Gaza, hitting people who were returning from a funeral near Gaza City.
The Israeli military said it was investigating the incident.
Rami Harra said his 17-year-old brother Muhmmad Harra was killed in the strike.
"He was at home when the explosion took place. He went out to see what happened and when he started to help evacuating wounded people who were on the ground another shell hit the place and killed him," he said outside the morgue. "Why did they kill him? I can't believe my eyes that I am seeing his dead body."
Ashraf al-Kadera, a Gaza health ministry spokesman, later said four civilians were killed and they were all aged between 16 and 18.
In a text message to reporters, Hamas spokesman Fawzi Barhoum threatened to respond.
"Targeting civilians is a dangerous escalation that cannot be tolerated. The resistance has the full right to respond to the Israeli crimes," he said.