“We saw many dead bodies,” said Mazen Abu Habil, a 52-year-old father of eight, who eventually made it to Khan Younis, which has become a teeming place of refuge for displaced people. There, Gazans cram into hospitals and U.N. shelters, living in substandard conditions — chasing a meal a day, sleeping with barely any blankets, wearing the clothes they fled with.

Mr. Abu Habil used to live in Jabaliya, a neighborhood north of Gaza City that Israel says is a Hamas stronghold and has been pummeling with airstrikes. He fled to Al-Shifa Hospital in Gaza City once his house was destroyed, and then, when it was no longer safe there, to Nasser Hospital in Khan Younis. Israel has recently produced video and photographs that it says shows Al-Shifa, a sprawling complex, conceals an underground military base used by Hamas. The militant group has denied it is operating from beneath the hospital.

“I saw a little girl who was killed on the ground,” Mr. Abu Habil said. With an eye on Israeli soldiers patrolling nearby, he said, he tried to cover the girl with a small cloth. “As I did that, they suddenly started shooting,” he said.

He described how the Israeli soldiers, many of whom spoke in Arabic, ordered him to undress and detained him for about 90 minutes. Eventually they let him go.

But that was not the case for everyone. Zahwa Al-Sammouni, 58, said she was fleeing south with her family when Israeli soldiers detained her three sons, all of them young men.

“What can we do?” Ms. Al-Sammouni said. “We’re too scared to yell or cry. We just want to know where did our kids go?”

She added: “We are farmers, we have nothing to do with weapons, with Hamas or with Fatah.” She added: “We are just looking for a piece of food because we have children to feed.”

She was squatting at the hospital in Deir El-Balah with more than a dozen members of her extended family.