At least 300 inmates were transferred from a Texas prison on Monday after a riot broke out in the facility — which holds mostly immigrants detained for crossing into the United States illegally — leaving it "uninhabitable," according to authorities.

The prisoners were protesting inadequate medical services, which — along with cruel treatment and sexual abuse — has been a common complaint in private prisons housing undocumented immigrants, according to the American Civil Liberties Union and other rights groups.

Icy conditions caused delays with the transfer of more than 2,000 others from the federal prison, local media reported.

The uprising, or unrest, as prison officials called it, began early Friday at the Willacy County Correctional Center — operated by the privately held prison company Management and Training Corp. on behalf of the U.S. Bureau of Prisons. Management and Training's 10-year contract with the federal government is worth about half a billion dollars.

The facility is about 40 miles from the U.S.-Mexico border in Raymondville, Texas, and has been nicknamed Ritmo, or Raymondville's Guantánamo, for its "crammed and squalid" conditions.

Two hundred inmates are packed into each Kevlar tentlike structure that serves as housing, with no privacy between beds or in the bathrooms, where toilets and showers are open without partitions, the ACLU said in a 2014 report titled "Warehoused and Forgotten."

Insects and spiders crawl through holes in the tents and bite detainees. Toilets frequently overflow, and the water was shut off for days in 2012 after it started to look yellowish-green, according to the report. Authorities gave inmates bottled water two days later.

Prisoners refused to go to breakfast or report for work on Friday in protest of what they said was inadequate medical service at the prison. Inmates broke out of housing structures and converged in the recreation yard, setting fire to several Kevlar structures.

Guards responded with tear gas and other nonlethal forms of crowd control, and only minor injuries were reported.

The riot left the prison "uninhabitable," according to Ed Ross, a spokesman for the U.S. Bureau of Prisons. As many as 2,800 prisoners will be moved to other institutions, he said.

It is not the first riot at the facility. Last February, authorities ordered a lockdown after a disturbance at the correctional center. State, county and local law enforcement agencies had to be asked to assist in guarding the facility, according to local media.

The ACLU report also found a pattern of abuse and inhumane conditions at four other privately run federal prisons in Texas that house immigrants.

Those facilities, known as criminal alien requirement (CAR) prisons for immigrants, house noncitizens, most of whom have been convicted of only immigration offenses.

“At the CAR prisons we investigated, the prisoners lived day to day not knowing if their basic human needs would be met, whether they would get medical attention if they were hurt or ill,” Carl Takei, a staff attorney at the ACLU’s National Prison Project, said in a press release last year. “The Bureau of Prisons creates perverse incentives for the for-profit prison companies to endanger human health and lives.”

The 13 CAR prisons in the U.S. hold more than 25,000 immigrants. This weekend’s uprising is the third such event at CAR prisons in the last seven years. In 2008 the death of inmate sparked an uprising at another Texas prison. And in 2012 a prison insurrection over mistreatment led to the death of a guard.

The Willacy facility was an Immigration and Customs Enforcement (ICE) detention center. But after “Frontline” reported rampant sexual and physical abuse and medical neglect at the facility from 2006 to 2011, ICE announced it was transferring detainees out of Willacy. Management and Training obtained a contract to hold prisoners for the Bureau of Prisons — the contract it operates under today, the ACLU said in its report.

With wire services