Jerusalem - The Israeli military says it has shelled militant targets in the Gaza Strip after its troops on the border came under fire.

The army said in a statement Wednesday it was “targeting Hamas military posts in the Gaza Strip” after soldiers were shot at.

A spokesman for the Gaza Health Ministry said two Palestinians were killed and one was seriously wounded in the strikes.

The cross-border exchange took place a few days after Gaza’s Hamas rulers agreed to a cease-fire with Israel to prevent weekend hostilities from escalating.

On Friday, a Palestinian sniper killed an Israeli soldier along the border — the first casualty it has sustained in four years — and Israel unleashed a massive offensive in response. Israel and Hamas have fought three wars in the past decade.