Thousands of Gazan men may have been detained by Israeli forces since war erupted on October 7 and often subjected to ill treatment that could amount to torture, the UN's human rights representative in the Palestinian territories said Friday.

Some of those released have reported being blindfolded, beaten and ultimately freed wearing only diapers, Ajith Sunghay said from Rafah in the southern Gaza Strip, speaking via video link to a press conference in Geneva.

Sunghay said he had met several released detainees who said they had been detained by Israeli security forces in unknown locations for 30 to 55 days.

"They described being beaten, humiliated, subjected to ill treatment, and to what may amount to torture. They reported being blindfolded for long periods -- some of them for several consecutive days," he said.

"One man said he had access to a shower only once during his 55 days in detention. There are reports of men who were subsequently released, but only in diapers," he added.

Sunghay said their testimonies were consistent with reports that the UN human rights office has received on the detention of Palestinians on a broad scale, "including many civilians, held in secrecy, often subject to ill treatment" and with no access to their families, lawyers or effective judicial protection.

Sunghay said he was unable to give an exact figure of the numbers detained but said it was "believed to number in the thousands".

He said Israel had an obligation to ensure that everyone detained was treated in line with international norms on human rights and humanitarian law.

"Unless Israel can demonstrate imperative security grounds for each person remaining in detention, they must be charged or released," he said.

"All instances of ill treatment or torture of people arrested or detained must be fully and transparently investigated," he added.

Fighting has ravaged the Gaza Strip since Hamas's attacks on Israel on October 7 that resulted in the deaths of about 1,140 people, mostly civilians, according to an AFP tally based on official figures.

Israel responded with a relentless offensive that has killed at least 24,762 Palestinians, around 70 percent of them women, children and adolescents, according to Gaza's Hamas-run health ministry.