(CNN) They say they were shackled and stripped-searched. Forced to wear prison uniforms. Confined to cells "for 22 hours per day."

It may sound like life as a convict in a federal prison. But these aren't inmates; they're immigrants, seeking asylum lawfully in the United States.

This was not the America that dozens of men expected when they crossed the US border -- some legally, some illegally -- to apply for asylum.

But as the ranks of immigrant detention centers have swelled under President Donald Trump's zero-tolerance policy, asylum-seekers were sent to a handful of Bureau of Prisons sites across the country, including this one in Sheridan, Oregon.

Now, nearly two months after most arrived at the prison southwest of Portland, the federal public defender in Oregon has petitioned a judge to release these immigrants, citing their claims of inhumane and "punitive" conditions -- akin to those described by immigrants detained at other facilities -- as they wait indefinitely to appeal to judges for asylum.

The legal action could require federal authorities, who have denied most of the allegations of mistreatment, to justify -- or end -- the detentions.

'I am disturbed mentally here'

After being held by US Immigration and Customs Enforcement in overcrowded detention facilities along the border, the men were taken in shackles and handcuffs on May 31 to the Oregon facility, court documents filed by Lisa Hay allege.

Countries with most immigrant detainees in Sheridan, Oregon Claimed origin / number of detainees India 52 Nepal 18 Guatemala 12 Mexico 10 Source: ICE, June 2018

ICE last month said 123 male immigrant detainees were held at Sheridan. Seventy of them were from India and Nepal; 33 were primary Spanish speakers, the agency said.

They were not given adequate medical treatment, the detainees claim in court documents.

"Nobody told me how to access medical services, so I never ask for them," an immigrant identified as Detainee 1 said in a filing. "A guy in the cell next to me has been requesting medical attention for a week and has not gotten it."

Some detainees suffered untreated conditions or injuries, chief investigator William Teesdale of the public defender's office said in a court declaration.

"Detainees reported heart problems, a gunshot wound, a broken leg, rashes, allergic reactions and severe sore throats," he said in a declaration. "Detainees reported trying to tell the prison guards about their medical concerns, but being unable to communicate adequately in English."

Some spoke of suicidal thoughts, the records show.

Another detainee claimed he and others "were kept with gangsters inside (the cell) for 22 hours. ... I am disturbed mentally in here."

Some said they were housed, at times, three people to a 75-square-foot cell, eating in the crammed quarters near an open toilet. Another said they wore the same uniforms for nearly a week.

"We were searched naked in front of everybody," another said.

Detainees who practice the Sikh religion said they were not allowed to wear turbans, a tenet of their religion . One tried to improvise.

"I had wrapped (a) towel on my head, but it was taken off," a detainee wrote in court documents. "It is a violation against our religion."

"These folks were subjected to detention and condition that is at its core punitive," said Leland Baxter-Neal, staff attorney at the ACLU of Oregon.

Prisons adapt to influx of detainees

Protesters last month lined its outer fence, demanding the detainees be released.

In court documents filed in response to the public defender's petition, the Bureau of Prisons acknowledged it had little notice of the detainees' arrival and initially had to treat them as part of the prison system for security reasons.

"The prison had 24 hours' notice," Baxter-Neal, the ACLU attorney, told CNN. "All of a sudden, there were 130 mattresses delivered to the facility, and the next day, people were brought."

The BOP said it sought a long-term fix and after three weeks separated the detainees into an area that would "eliminate the need to lock down" the cells as the immigrants moved about. That change also served to "increase access to (phone) calls" that the detainees were asking to make, the agency said in court records.

But Baxter-Neal, in a phone call with reporters, said the improvements happened only after the ACLU and Innovation Law Lab, a nonprofit immigrant legal service, sued the Department of Homeland Security for permission to let their volunteer attorneys and interpreters speak with immigrants inside the facility.

A judge agreed and ordered the lawyers be allowed in.

Health care and services offered, official says

A Bureau of Prisons spokesman this week offered a point-by-point response to the immigrants' claims, first disputing that ICE detainees are confined to their cells for 22 hours a day.

"There are opportunities for inside and outside recreation," he said in a statement to CNN.

Further, ICE detainees "are placed in restraints only for escort and as a last alternative to resolve a situation," the spokesman told CNN by email, adding that "for the safety and security of detainees, inmates, visitors and staff, visual searches may be conducted when detainees have in-person 'contact' visits with members of the public in a visiting room."

"When searches are performed, curtained partitions are used for privacy," he said.

All ICE detainees also were medically screened when they arrived at Sheridan, the spokesman said, noting that "several" arrived with "healed bullet wounds" and none has been found to have a broken leg.

The bureau provides detainees, he said, with "preventive health screening, episodic ('sick call') visits, emergency visits, and during regularly scheduled chronic care clinics" while taking "necessary precautionary measures to protect staff, inmates and detainees, and the community from communicable illnesses that include testing, treatment, prevention, education, and infection control measures."

ICE detainees who don't speak English have access to bilingual staff and translation services, he said.

As for religious accommodations, "upon arrival at FCI Sheridan, ICE detainees were not wearing turbans nor have they made a request to staff to obtain one. However, staff are working to secure a vendor to allow ICE detainees who wish to order turbans to do so through the institution's commissary," the spokesman said.

Waiting to learn their fate

Domestic and international law holds that immigrants who fear persecution in their home countries are legally entitled to seek asylum in the United States regardless of how they enter the country. But the Trump administration has sought to reshape US policy by allowing officers who interview asylum-seekers to weigh whether an immigrant crossed the border illegally against their asylum claim.

The immigrants represented in the public defenders' lawsuit are all detained pending immigration proceedings for asylum claims. It's not clear whether any face misdemeanor charges for crossing the border illegally, though some admittedly entered the country by doing so. Others arrived without paperwork to enter the country at a legal border crossing, where they said they wanted to seek asylum.

Hay, the public defender, would not comment on any of the cases beyond the court records.

So far, the Innovation Law Lab has completed at least 100 screenings to assess the legal needs of the detained men, and the government has conducted 42 "credible fear interviews" to determine whether an immigrant meets the threshold to pursue an asylum claim, according to the organization, which corrals resources for immigration lawyers.

"So far, we have received 20 positive decisions for credible fear interviews," meaning the immigrant qualified for a fuller hearing to make their case, said Victoria Bejarano Muirhead of the Innovation Law Lab.

That record offers some hope to those still housed in the prison, she said.

"One of the men from Nepal cried upon hearing he would not be immediately deported because his credible fear interview passed muster," she said.