BEERSHEBA, Israel  The soldiers lingered, arms linked in a chain of khaki around the grave. Their instructions were to disperse quickly after the ceremony because of the threat of rocket fire, but it was hard for them to leave. Many had just come from the fighting in Gaza.

The young staff sergeant they buried Wednesday in the military cemetery of Beersheba, in southern Israel, was the sixth soldier to have been killed in Gaza since Israel’s campaign against Hamas started Dec. 27.

Then the siren wailed. Everyone scattered, looking for shelter, aware that there was maybe half a minute before the rocket, or rockets, fired out of Gaza would land. Some dropped to the ground. Others were crammed into a small concrete-roofed structure nearby. There was a boom, then a second and a third.

The rockets hit open ground in and around Beersheba, causing panic but no serious injuries. But the knowledge that this city, the fourth largest in Israel and a half-hour drive east of the Gaza border, was now within Palestinian rocket range, underpinned the determination of the soldiers who were about to return to the front.