The Israeli army confirmed the airstrike, saying warplanes bombed the facility after Palestinian militants in Gaza fired a rocket into southern Israel. No Israeli injuries were reported.
The air raid came a day after Israel said its navy intercepted a cargo ship carrying a massive arms shipment sent by Iran and destined for Gaza militants, the latest in a series of Israeli naval raids to confront Iran's growing influence in the region. Israel maintains that Iran is arming Israel's enemies with rockets and other arms.
Hamas security officials, speaking on condition of anonymity because they were not authorized to talk to the media, said the warplanes struck a Hamas security facility south of Gaza City. They said two members of the Hamas' movement were killed.
Gaza health official Adham Abu Salmiya said four others were wounded. Hamas is believed to be an Iranian-backed militant group that opposes peace with Israel.
Israel has long accused Iran of providing arms and money to Hamas. Following Tuesday's raid, Israel's navy said it found sophisticated land-to-sea missiles that could change the balance of power in the area.
They said the shipment also included Farsi instruction manuals, proving Iranian involvement.