Cease-fire talks in Gaza have stalled again, in part over Israel’s demand to retain a military presence in the territory, which Hamas and Egypt oppose. But the view among some Gazans on that point is less clear-cut.

Their lives have been devastated after almost a year of war and they say they find the idea of Israeli soldiers staying on — and of the checkpoints becoming permanent — disturbing. But if that helps bring an end to the war, it is a price they are willing to pay. Other Gazans expressed serious misgivings about allowing an Israeli military presence in Gaza, and some opposed it outright.

“Of course I do not accept the presence of checkpoints on our return to the north,” said Mohammad Qadoura, 40, who was displaced from his home in Gaza City. “But if this would lead to the end of the war, I would reluctantly agree.”

Abdul Aziz Said, 33, a social worker from central Gaza, said that if an Israeli presence in the territory was “what it takes to end this war, I would totally agree.” He added, “I want this war to come to an end now and at any cost.”

Israel has said that the presence of its soldiers in Gaza after a permanent cease-fire is necessary to prevent Hamas from regrouping and weapons from being smuggled across the territory. In particular, Israel wants some Israeli troops to patrol part of the Egypt-Gaza border because it believes Egypt has not done enough to prevent Hamas from smuggling arms. And Israel believes that having Israeli troops within Gaza would aim to prevent Hamas fighters from going back en masse to regroup in the northern part of the enclave.

The latest high-level effort to reach a cease-fire agreement in Gaza ended on Aug. 25, with Israel and Hamas, the group that governs the enclave, remaining far apart on several critical issues. One of those, according to an American official who spoke on the condition of anonymity to discuss the sensitive negotiations, is whether Israeli forces will remain on the Gaza side of the border with Egypt, and if so, how many.