Hamas warned "the enemy will pay a tremendous price," referring to Israel. The group said its men were killed by an Israeli airstrike on a tunnel used by the militants.
Two militants from a different group were also killed in a separate strike. The men were involved in rocket attacks on southern Israeli communities, according to the Israeli military.
Israel said it carried out airstrikes on at least "14 terror sites" including "concealed rocket launchers" in Gaza yesterday in retaliation to a recent spike in attacks from Gaza.
About a dozen rockets were fired at Israel from Gaza overnight and one injured a soldier.
Lieutenant colonel Peter Lerner, a military spokesman, said the rocket attacks were "unbearable and unacceptable". He added: "We will continue to act in order to debilitate and incapacitate the Hamas terror infrastructure, striking its warehouses, rocket manufacturing capabilities and those that endanger the well-being of the Israelis in the south of the country."
Tensions have soared in Israel and Palestinian territories since three Israeli teenagers were kidnapped while hitchhiking in the West Bank last month. Last week, their bodies were found in a West Bank field in a gruesome crime Israel blamed on Hamas, which controls the Gaza Strip.
Hamas, which has kidnapped Israelis before, praised the kidnapping and killing of the teenagers but did not take responsibility for it.
Just hours after the youths were buried, Mohammed Abu Khudair, a 16-year-old Palestinian-American from east Jerusalem, was abducted near his home and his charred remains were found a short time later in a Jerusalem forest.
Israel has arrested six Jewish suspects for the crime as Israeli leaders appealed for calm amid signs the death was revenge for the killing of the three Israeli youths.
Mr Khudair's killing set off a wave of violent Palestinian protests in and around Jerusalem that later spread to Arab towns in the north.
Israeli leaders, including Prime Minister Benjamin Netanyahu, condemned the murder of the Palestinian teenager.
Mr Netanyahu promised to prosecute those responsible to the full extent of the law.
He said: "We will not allow extremists, it doesn't matter from which side, to inflame the region and cause bloodshed. Murder is murder, incitement is incitement, and we will respond aggressively to both."
Mr Netanyahu later phoned the father of the murdered Palestinian teenager to promise the attackers would be prosecuted.
The Prime Minister told Hussein Abu Khudair: "I wish to express my shock and the shock of Israel's citizens over the despicable murder of your son.
"The murderers will be brought to trial and prosecuted to the full extent of the law."
Other family members, echoing Palestinian President Mahmoud Abbas, have accused far-right Jewish settlers of killing the teenager.
Israel's outgoing president Shimon Peres and his successor Reuven Rivlin have promised there will be no cover-up in the investigation of the Palestinian's death.