Cold, almost naked and surrounded by Israeli soldiers with M16 assault rifles, Ayman Lubbad knelt among dozens of Palestinian men and boys who had just been forced from their homes in northern Gaza.

It was early December and photographs and videos taken at the time showed him and other detainees in the street, wearing only underwear and lined up in rows, surrounded by Israeli forces. In one video, a soldier yelled at them over a megaphone: “We’re occupying all of Gaza. Is that what you wanted? You want Hamas with you? Don’t tell me you’re not Hamas.”

The detainees, some barefoot with their hands on their heads, shouted objections. “I’m a day laborer,” one man shouted.

“Shut up,” the soldier yelled back.

Palestinian detainees from Gaza have been stripped, beaten, interrogated and held incommunicado over the past three months, according to accounts by nearly a dozen of the detainees or their relatives interviewed by The New York Times. Organizations representing Palestinian prisoners and detainees gave similar accounts in a report, accusing Israel of both indiscriminate detention of civilians and demeaning treatment of detainees.

Israeli forces who invaded Gaza after the Oct. 7 Hamas-led attack have detained men, women and children by the thousands.

Some were ordered out of their houses and seized while others were taken as they fled their neighborhoods on foot with their families, trying to reach safer areas after the Israeli authorities ordered them to leave.