The Israeli strike came on the second day of severe escalating violence between Israel and Hamas, injuring at least 18, with some in critical conditions, according to Palestinian media.
Ronen Manelis, Israeli army spokesman, said fighter jets targeted the five-storey building located in the Rimal neighborhood in northern Gaza.
"The building was used by Hamas interior security forces for military purposes," Manelis told Channel 10 TV news.
A statement released by the army described the strike as "a response" to an earlier rocket attack by Gaza militants on the Israeli city of Be'er Sheva, some 40 km from the Gaza Strip.
The rocket fell in an open field outside the city, without causing damage.
Earlier in the day, Hamas, the Islamist Palestinian movement that runs Gaza, said it would hold its fire after having launched some 200 rockets toward southern Israel since Wednesday evening.
However, after an Israeli military drone reportedly fired a missile toward a group of Palestinians near Gaza's al-Tuffah, Gaza militants retaliated with more rockets, including the one fired at Be'er Sheva.
Israel later carried out dozens of airstrikes throughout the besieged Palestinian enclave, killing three people, including a pregnant woman, her baby and a Hamas fighter.
The Israeli cabinet was summoned in Tel Aviv to discuss the next move and whether to approve a cease-fire proposal brokered by Egypt and the UN, or to escalate its assaults in Gaza.
In the early evening hours, Israel showed yet no signs of cease-fire, as a government official told Walla news site that "Hamas suffered a severe blow. Israel will continue to act with force."
Israeli Prime Minister Benjamin Netanyahu and Defense Minister Avigdor Lieberman instructed the military to prepare for "any possibility," the official said on condition of anonymity.
Meanwhile, UN Special Coordinator for the Middle East Peace Process Nickolay Mladenov urged both sides to avoid further escalation.
"Our collective efforts (with Egypt) have prevented the situation from exploding until now," Mladenov said in a statement.
"If the current escalation, however, is not contained immediately, the situation can rapidly deteriorate with devastating consequences for all people," he added.
The recent flare-up began on Wednesday evening, when Gaza militants fired rockets toward the southern Israeli city of Sderot, injuring about nine.
Overall, about 200 rockets have been launched toward southern Israel since Wednesday night, the Israeli army said, adding that some 30 of them were intercepted by its Iron Dome rocket defense system, while most of the others fell in open fields.
About 23 Israelis had been injured, according to the Israeli authorities.
The rocket attacks from Gaza came after Israel killed two Hamas snipers in the coastal enclave on Tuesday. Hamas vowed to make Israel pay for the killing.
It was the third serious flare-up of violence since July and came amid attempts by UN and Egypt to broker a cease-fire between Israel and Hamas.