The Israeli military spokesman's office said the strike was launched in response to rocket fire at southern Israel, and that targets were hit. It did not elaborate.
Palestinian health official Adham Abu Salmia said the men could not be immediately identified, so it was not clear whether they were civilians or militants. He said they died in an Israeli military strike, and it appeared he and the military were referring to the same attack.
Israel-Gaza violence has flared in recent days, with four Palestinian militants killed Monday in airstrikes launched in retaliation for rocket fire. Over the past 24 hours militants fired six rockets, the military said.
In another development, vandals torched and scrawled graffiti on a Palestinian mosque in the West Bank on Tuesday, Israeli security officials said, and suspicion fell on radical Jewish settlers angry over the looming demolition of an unsanctioned settler enclave.
By July 1, the government has committed to destroying 30 apartments settlers built illegally on privately held Palestinian land. Acts of vandalism against Palestinian property have been expected ahead of that date because radical settlers routinely attack Palestinian targets in retaliation for government settlement policy they oppose.
The Hebrew-language graffiti spray-painted on the mosque in Kfar Jabaa read, “The war has just begun, you'll pay the price,” the military spokesman's office said.
Prime Minister Benjamin Netanyahu condemned the attack and said authorities would act swiftly to bring the vandals to justice.
“This is an act of intolerant and irresponsible lawbreakers,” he said.
Police said no suspects had been arrested in the predawn attack.
Netanyahu, a longtime settlement champion, unsuccessfully tried to avert a Supreme Court order to demolish the homes of 30 families in the Ulpana enclave near the Beit El settlement.
But the court rejected his efforts because the apartments were erected on privately owned Palestinian land, something it outlawed decades ago, even as it authorized settlement construction on other West Bank territory.
The government is trying to work out a deal with the Ulpana families to entice them to leave peacefully. In the meantime, Netanyahu has promised to build hundreds of apartments in Beit El and elsewhere in the West Bank to compensate settlers for the buildings that will be lost.
Israeli construction on lands the Palestinians claim for a future state is at the heart of the current peacemaking deadlock.
Palestinians want all construction in the West Bank and east Jerusalem to stop before they will return to the negotiating table. Israel, which captured both territories in 1967, rejects their demand and says talks must proceed without conditions.
Settler leader Dani Dayan condemned the assault on the mosque and said settler involvement wasn't out of the question. In an interview with Israel Radio, he cautioned that such acts “do immense damage” to the settlement movement.