Israel’s military said it struck dozens of Hamas targets in the Gaza Strip and the Islamist group launched numerous rockets into its territory, raising the risk of a wide-scale conflict two weeks before an Israeli election.

The latest exchange of fire comes after the Israeli military blamed Gaza-ruler Hamas for an attack earlier Monday that hit a home in the small town of Mishmeret north of Israel’s commercial capital of Tel Aviv, injuring seven people.

In...