The Israeli military says it struck several militant sites in the Gaza Strip after a Palestinian rocket hit a building in southern Israel.

The army said Israeli warplanes attacked "terror infrastructure" in Gaza early on Friday, including military and naval compounds belonging to Hamas, the Islamist group that controls the territory.

There was no immediate retaliatory rocket fire from Gaza, or reports of injuries on either side.

The army said the rocket launched late Thursday hit a religious school in the Israeli border of Sderot.

The flare-up, which came after Israel this week closed Gaza's offshore waters to fishermen in response to the launch of incendiary balloons, breaks a month-long lull.

A cease-fire between Israel and Hamas reached in May halted the worst bout of violence since a 2014 war.