Palestinian militants carried out the deadliest single attack on Israel’s forces since the Hamas raid that triggered the war, killing 21 soldiers, the military said Tuesday, a significant setback that could add to mounting calls for a cease-fire.

Hours later, the military announced that ground forces had encircled the southern city of Khan Younis, Gaza’s second largest. That marked a major advance, but it was unclear how much closer it would bring Israel to defeating Hamas or freeing Israeli hostages — two central war aims that have proved increasingly elusive — as cease-fire talks appear to be gathering pace.

Prime Minister Benjamin Netanyahu

mourned the soldiers, who died when the blast from a rocket-propelled grenade triggered explosives they were laying. But he vowed to press ahead until “absolute victory,” even as Israelis are increasingly divided over whether it’s possible to both crush Hamas and free scores of captives.