Netanyahu was hustled off stage when sirens warning of incoming rockets blared in the southern city of Ashdod late Tuesday, public television reported.
It came just hours after the premier pledged to annex the Jordan Valley in the occupied West Bank if re-elected in September 17 polls.
Israeli fighter jets "struck 15 terror targets in northern and central Gaza Strip," including a weapons factory, an attack tunnel and naval targets, the army said.
Thousands in Israel anti-graft demo after Netanyahu indictment call
It said it would continue to hold Hamas responsible for all rocket fire that comes from the Gaza Strip, regardless of who actually fired the weapons.
A security source in Gaza confirmed a number of Hamas bases had been struck, without causing any casualties.
Both rockets fired from Gaza were shot down by Israel's Iron Dome air defence system.
Hamas has been the de facto rulers of Gaza since they ousted forces loyal to president Mahmud Abbas in deadly fighting in 2007.
Video distributed by Netanyahu's right-wing Likud party showed him returning to the stage after the all-clear and saying that Hamas was scared of him winning next Tuesday's general election.
"If it attacks us on live TV, you understand that it doesn't want us here," he told his audience.
Arch-foes Hamas and Israel have fought three wars since 2008.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ