They grew up in Cuba , studied to become doctors and swore an oath to do no harm.

Then, years later, they ended up somewhere they never expected: a privately-run US immigrant detention center in rural Louisiana.

Held behind bars as they pleaded for asylum, these men say they watched people around them receiving poor medical care, but -- despite their years of training -- felt powerless to help.

It's a rare perspective that hasn't been heard in the US immigration debate.

These men aren't auditors paid by prison companies. They aren't government experts dropping by for occasional inspections. They aren't activists protesting conditions they haven't had a chance to see with their own eyes.

They're doctors who became immigration detainees themselves -- held for more than a year inside a system that they warn is putting people's health at risk daily. One remains detained; the other was just deported after more than 15 months behind bars.

Among their allegations, made in court filings and detailed in interviews with CNN: mold on the walls, incorrect diagnoses and improper use of quarantines.

In a statement released to CNN, the private prison company that runs the facility said it "strongly disputes" any allegations of inadequate medical care. ICE said it couldn't comment on the specific allegations due to pending litigation, but said the agency provides "comprehensive medical care" and is committed to the welfare of everyone in its custody.

"Their perspective and their insight is extremely eye-opening," says Laura Rivera, director of the Southeast Immigrant Freedom Initiative at the Southern Poverty Law Center, which is representing the doctors in a class-action federal lawsuit over ICE detention and parole practices. "Here you have people who understand what it means to take an oath to do no harm. ... They're trained to evaluate and diagnose and treat, and they're seeing the failures of the system at every step of the way."

He said guards painted over mold on the walls rather than fixing the problem

It was July 2018 when a Cuban doctor arrived at the Laredo, Texas, port of entry, and told authorities he was fleeing persecution in his home country and seeking protection in the United States. Like thousands of others who arrive at the border seeking asylum, he was transferred to Immigration and Customs Enforcement custody.

The moment he settled into his bunk at the Pine Prairie ICE Processing Center in Pine Prairie, Louisiana, the 31-year-old Cuban doctor says he noticed something was off. Mold grew on the wall and water dripped down onto his bed, he wrote in a sworn declaration filed in court in June. He covered part of the wall with garbage bags to keep it away from his pillow.

Still, he said, water would run down the wall and pool onto the floor.

He and fellow detainees pointed the mold out to guards, he said, and warned that the pooling water was a safety hazard. Their response: repaint the wall.

"They did nothing for two months," he wrote in his declaration. "Then they simply painted over the mold."

The doctor was recently transferred to a detention center in Alabama and deported after being held for more than a year at the Pine Prairie facility. His attorney asked CNN not to name him out of fear for his safety.

While he waited for months to learn his fate, the doctor told CNN he felt he had no choice but to speak out about what he'd witnessed in the United States -- just as he says he spoke out about unjust medical care he saw in Cuba.

"It's what I know," he said, "and it's the only way I can help."

In his June court filing, he described the conditions he observed at Pine Prairie as "unsafe, unsanitary and discriminatory."

One day, a detainee slipped and fell in a puddle made by the pooling water and broke both his arms, the doctor said in the court filing.

That's not the only injury that could result from the conditions, the doctor said. He worried that mold on the walls and poor ventilation were causing deeper medical problems that could emerge years later.

"It has become quite clear to me that our safety is not a priority of the staff here, which is deeply upsetting," he alleged in his June court filing.

ICE says it spends $260 million every year on health care for detainees

The Pine Prairie ICE Processing Center, where both doctors who spoke with CNN were detained for the majority of their time in US custody, is about 45 miles south of Alexandria, Louisiana, and about 200 miles from New Orleans.

The Pine Prairie ICE Processing Center is located in Louisiana, a growing hub for the agency.

Owned and operated by one of the nation's largest private prison companies, The GEO Group, it can house nearly 1,100 adult male detainees, and it's currently one of nearly a dozen detention facilities ICE uses in Louisiana , a growing hub for the agency in the past year.

ICE declined to respond to the specific claims the doctors made, citing the agency's policy not to comment on pending litigation. "Lack of comment should not be construed as agreement with or stipulation to any of the allegations," spokesman Bryan Cox said in an email.

ICE detainees across the US have access to physicians, nurses, mental health care providers, dental care and 24-hour emergency care, Cox said. And nationwide, he said, the agency spends more than $260 million annually on health care services for detainees.

A GEO Group spokesperson said the company disputes any allegations of inadequate medical care at its facilities.

"We recognize the majority of residents would prefer to be outside these Centers," the statement said, "but while the immigration and legal processes run their course which our company plays no role in, we are committed to protecting those entering our facilities and ensuring they are provided high-quality, culturally responsive services in safe, secure and humane environments, and are treated with compassion, dignity and respect."

GEO says detainees undergo medical, mental health and dental screenings when they arrive at Pine Prairie and are provided with 24/7 medical services. The medical program there is accredited by national organizations and "strictly complies" with ICE detention standards established under the Obama administration, according to GEO.

Pine Prairie's last annual inspection , which included experts in medical care, took place in April, Cox said. The facility was "found to be fully compliant with all 40 categories reviewed by the inspection team," he said.

Unable to see patients, he offered to mop the infirmary floors

While playing baseball was his first love, the doctor said practicing medicine was a calling that inspired and defined him. He loved connecting with his patients and helping to heal them. Even in his spare time, he'd watch medical dramas like "ER," "Grey's Anatomy" and "House," then eagerly research the rare illnesses he'd learned about in each episode.

Even though he left his career in Cuba behind when he fled to the United States, the doctor said he mentioned his profession during his initial medical checkup when he arrived at Pine Prairie last year. He hoped he'd be able to assist them somehow -- to be a bridge between his fellow detainees and the facility's medical staff. Later, once he realized that wasn't a possibility, he asked if he could take on a different task.

"I wanted to clean the infirmary," he said. "At least I'd be more or less in my world, even though I'd be cleaning."

Instead, he said, he was given a job working in the kitchen.

It's not clear how many of the more than 50,000 people detained in ICE facilities are doctors. Those who spoke with CNN said they'd heard of other doctors being detained, but never met them.

Instead of the white coat he once wore making hospital rounds, on most days at Pine Prairie, the doctor sat in his bunk wearing a white T-shirt and orange pants. But he said fellow detainees started coming to him for help as word of his past life spread.

"Here, I am not a doctor. I cannot prescribe anything," he told CNN in a phone interview from the detention facility over the summer. "But I give them advice. I tell them, 'Go to the doctor and tell them this is what you have, and when you were sick with it another time, this is what you took.'"

He's concerned medical problems are minimized

In his court-filed declaration, the doctor detailed how he and others who've sought treatment while detained felt their concerns weren't taken seriously.

"They don't see you as a patient," he told CNN. "They see you as a prisoner."

He said this led to incorrect diagnoses, improper treatment and delays in care -- problems he believed he saw play out time and again in the more than a year he was held in ICE detention.

"If an urgent medical request is filed, it can take four or five days for officers to take the sick individual to the medical unit," the doctor said in his court declaration. "I have met individuals with many medical conditions who are not receiving the treatment they urgently need."

In the filing, the doctor described what he said was a particularly troubling example.

At one point, he wrote, a bunkmate with night sweats, skin lesions and swollen lymph nodes was only treated with Tylenol even though he was likely suffering from a serious illness.

The doctor acknowledged he didn't know what his bunkmate's final diagnosis was, but feared the man missed "months of necessary treatment."

Budgets and bottom lines seem to matter more in decisions, the doctor believes, than symptoms and sickness. He fears healing patients isn't the only priority for staff at Pine Prairie and other ICE detention facilities.

"It's to save money," he said.

Another Cuban doctor who was transferred into ICE custody after asking for asylum at the border told CNN he's had a similar experience while he's been detained, advising fellow detainees as medical problems come up. That doctor, who said he fears persecution in Cuba and asked to be identified only by his initials, P.S.P., described what he said in a June court filing were "foul conditions" at Pine Prairie. He spent months there and was transferred to a different facility in Mississippi over the summer.

"It's been very, very difficult and draining to be here, seeing people keep getting deported," he says.

P.S.P. hopes to study medicine again in the United States and embark on a new career here. But he's worried he won't get the chance.

"I have lost myself since being in detention," he said in a court filing this year. "I may never be able to practice medicine again."

They question whether quarantines were handled properly

Inspectors noted in April that a mumps outbreak at Pine Prairie had required quarantining more than 500 detainees there.

The first doctor who spoke with CNN said he was one of them. A quarantine forced him to miss a court date and made it harder to meet with his lawyer, he says in his court declaration. But, he said at the time, no one around him showed any sign of the illness.

"As a doctor, I know how to recognize the symptoms of mumps, and I never saw a single person in my bunk with mumps while we were quarantined," he wrote in his court declaration.

Another time when he and several others did have symptoms of the disease, he said, they weren't diagnosed with it or placed in quarantine.

"I think it is highly unjust for doctors to review patients and fail to provide them with an accurate diagnosis and proper treatment," he said in his court declaration. "It seems to me like the jail only uses quarantines when it is convenient for them."

P.S.P. also says he saw multiple mumps quarantines during his time in detention.

"Often, the prison officials use illness as a weapon to punish all the inmates, by placing us under quarantine, which is very similar to isolation," he said in his court declaration.

In June, an ICE official told CNN that the agency had successfully prevented communicable diseases from spreading in the past, but added that the recent wave of quarantines would likely lead to increased time in detention and delays in deportations.

They sued over ICE's parole practices

Both doctors are plaintiffs in a lawsuit filed against ICE earlier this year.

But medical care in custody wasn't the focus of that class-action case, which was filed by the SPLC and the American Civil Liberties Union of Louisiana and has nearly a dozen plaintiffs.

The federal suit alleges that ICE officials in the agency's New Orleans district -- which covers Alabama, Arkansas, Louisiana, Mississippi and Tennessee -- have been violating their own policies and issuing blanket denials of parole to asylum seekers who could qualify for release.

Government attorneys denied that accusation and asked a judge to dismiss the case.

A judge ruled in the plaintiffs' favor last month, issuing a preliminary injunction ordering ICE to follow its policies and weigh each parole request individually.

The case is still pending, and attorneys are sorting out the next steps.

Meanwhile, the doctors' descriptions of mold, quarantines and medical care are just a few paragraphs in a growing stack of legal filings.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

Why mention such matters in this lawsuit at all?

The doctor who was recently deported said the oath he swore to uphold was still guiding him.

"It's what I know -- medicine. And it's the only way I can help, by denouncing the bad treatment of people and the bad medical attention. I denounced it in my own country. And I came here and denounced it, too," he told CNN in a phone interview from Pine Prairie, weeks before his deportation.

"We are talking about human lives. It is more important than parole. It's more important than all of this, that lives are not lost."