The Israeli military said it launched air strikes against Hamas targets in Gaza after a rocket fired from the enclave exploded in the city of Ashkelon.