Unaccompanied minors who crossed the U.S.-Mexico border during a historic wave of migration earlier this decade were repeatedly beaten, sexually abused, and deprived of food and medical care by federal border agents, according to an American Civil Liberties Union report released Wednesday.

About 30,000 pages of documents obtained by the ACLU through an open-records lawsuit depict a gantlet of alleged mistreatment for the tens of thousands of children who arrived mainly from Central America between 2009 and 2014, during the Obama administration. Many were seeking asylum in the United States after fleeing death threats and violence in their homelands.

U.S. Customs and Border Protection agents allegedly used stun guns on the minors for amusement or punishment, kicked them and threatened to either rape or kill them. The ACLU report — which is based on emails, complaint forms and investigative reports — says agents routinely kept minors in detention cells with frigid temperatures, forcing them to sleep on concrete floors.

When the complaints were filed to the Department of Homeland Security, they were largely dismissed, the ACLU said, revealing what the advocacy group described as “a culture of impunity” among federal government agents charged with protecting immigrant children in their custody.

“You have no clear sense of how or whether these agents were reprimanded,” said Astrid Dominguez, director of the ACLU’s Regional Center for Border Rights.

CBP officials called the organization’s conclusions “unfounded and baseless,” noting that most of the claims cited in the report were ruled unfounded by DHS.

“These allegations were investigated and dismissed by the Office of the Inspector General for a reason,” DHS spokesman Katie Waldman said. “Packaging dozens of patently baseless allegations and calling it a ‘report’ does not change the fact it is just a collection of patently baseless allegations.”

The report ignores improvements in oversight made since 2014, including stricter guidelines on use of force and a zero-tolerance policy on sexual abuse, CBP said. It also disregards the fact that the DHS inspector general’s office, responding to previous complaints of abuse, conducted unannounced visits to 41 CBP facilities in 2014 and found no improprieties, the agency said.

“CBP takes seriously all allegations of misconduct, but without new specifics is unable commence reasonable steps to examine these assertions and address the accusations levied,” Dan Hetlage, a CBP spokesman, said in a statement.

The ACLU initially sought the documents used in the report in a public-records request. When that request was denied, the organization filed the lawsuit, eventually gaining access to the records.

Nearly 134,000 unaccompanied minors have entered DHS custody since the fall of 2014, according to federal statistics.

Recently, the Trump administration has proposed new regulations for how those minors should be treated, including stripping some federal asylum protections from them if they reconnect with an adult relative in the United States, which DHS argues would mean they are no longer “unaccompanied” minors.

ACLU attorney Mitra Ebadolahi said the records obtained through the lawsuit indicate that DHS investigators often took agents’ word over the children’s, in one case closing an investigation after one group of agents said they couldn’t remember their accuser.

Some of the reports were filed by service providers who saw bruises on the children or heard their stories.

“These are allegations that span across multiple years, multiple states, involving children from different backgrounds,” Ebadolahi said. “The consistency to them, to us, indicates that there’s truth there.”

The report describes a pattern of behavior that ranges from “neglectful” to “sadistic.”

In one case, an agent allegedly pushed his stun gun into a boy’s stomach, shocking him, then kneed him twice in the same spot.

In another, a 16-year-old girl being held just outside Phoenix claimed that an agent “forcibly spread her legs and touched her private parts so hard that she screamed.”

One boy was allegedly forced to strip down to his boxers inside one of the cold detention cells, widely known among undocumented immigrants as “hieleras,” or “freezers.” Another teen who had swam across the Rio Grande claimed he was placed in a frigid cell while still wearing wet clothes.

A 16-year-old girl held in a California detention center with the baby she had brought with her recounted how an agent stood at the cell door and calmly threatened to rape her and then place her child in foster care.

“We saw so many reports of physical abuse, both violent and humiliating,” said Nabihah Maqbool, a University of Chicago Law School student who helped compile the report. Maqbool cited claims of minors being forced to sign voluntary deportation orders under the threat of rape or injury and of being denied medical care.

The ACLU claimed CBP forces have increased steadily over the past decade without proper training. Currently, the agency has about 21,000 border patrol agents, up from 17,500 in 2008, federal statistics show.

Fatigue among agents in the face of so many arriving unaccompanied minors could have also led to misconduct, the report says.

In one 2014 email, a federal inspector asks whether it is worth investigating a complaint filed by a minor who said he had been kept in a detention center for four days and witnessed another child emerge from a holding cell with bruised arms and lips.

“Are we sure we want to open this given the huge amount of more serious complaints we have?” the email read.