JERUSALEM — More than two dozen people were killed and homes and businesses destroyed in the weekend’s fighting between Israel and Gaza, but on Monday leaders on both sides declared themselves satisfied with the outcome.

The cycle of violence-ceasefire-repeat that keeps verging on all-out war may look like pointless destruction to the outside world. But analysts say it is amply serving the interests of the two main antagonists.

Prime Minister Benjamin Netanyahu of Israel gets to batter Hamas, the militant group that controls Gaza, while bolstering his argument that the Palestinians are not ready for peace and that a two-state solution is impossible.

Hamas, which sought and apparently received renewed assurances of a loosening of the Israeli blockade of Gaza, gets to show skeptical, impoverished Gaza residents that its strategy of armed resistance is working.