SAN DIEGO (AP) — Many U.S. holding cells along the Mexican border were less than half full, even empty, during an unprecedented surge of asylum-seeking families from Central America, newly unsealed court documents show, raising questions about the Trump administration’s claims that it had to make people wait in Mexico because it didn’t have the means to accommodate them.

Holding cells were no more than half full at 18 of 24 border crossings on a majority of days between July 2018 and June 2019, according to the analysis of government data. Cells in the Texas cities of Laredo and Brownsville were no more than half full on nearly nine out of 10 days during the 12-month period. Cells at some smaller crossings were often empty.

Legal advocates for immigrants say the figures show that Trump administration officials were making up excuses to keep people from entering the U.S. to apply for asylum.

Customs and Border Protection has long maintained that the number of people it can imprison in at any time is governed not just by the amount of holding-cell space but by manpower. And during the surge, the staff was stretched thin dealing with priorities deemed more important, such as fighting drug trafficking and inspecting truck cargo.

Also, holding-cell figures do not tell the whole story, a senior official said in the unsealed documents. Some cells are less than full because some people must be isolated from others for safety reasons. For example, someone arrested for a crime would be held in a cell alone, as would a family with lice, or people with tattoos indicating gang membership.

A federal appeals court unsealed the documents after a request from The Associated Press. They were filed in a lawsuit that challenges Trump’s practice of forcing asylum-seekers to wait for weeks or months in dangerous Mexican border cities to request asylum in the United States.

Since 2016, U.S. authorities have adopted a practice they call metering, under which they accept a limited number of asylum-seekers per day at official crossings. As a result, huge waiting lists have taken shape at border towns in Mexico. The AP counted about 19,000 people on waiting lists in four cities last July.

Officials deny allegations that they are ignoring obligations under domestic law and international treaties to consider asylum requests, calling metering a matter of crowd management.

“It’s not turning people away; it’s asking them to wait,” then-CBP Commissioner Kevin McAleenan said in 2018.

The spread of waiting lists coincided with a series of U.S. measures that have dramatically reduced the flow of asylum-seekers, including one that returns people to Mexico to wait for immigration hearings in the United States. The putatively liberal Mexican President Andrés Manuel López Obrador knuckled under to Trump’s demands after Trump threatened to impose tariffs on Mexican-made goods and agriculture.

Legal advocates say asylum-seekers have ended up falling victim to rape, kidnapping and other crimes in Mexico, inflicted by gangs, drug cartels and police.

The documents showed wide variations in holding-cell occupancy rates, with a San Diego crossing, the largest along the border, operating near capacity almost every day, and others regularly well below the limit.

On March 14, according to a daily snapshot, 672 people were in custody at all 24 crossings, a 57% occupancy rate. San Diego’s San Ysidro port of entry was 89% full, Hidalgo was overcrowded, and El Paso was nearly full. But Laredo was only 40% full, Brownsville was at 35%, and seven crossings, mostly in California, were empty.

Cells at some smaller crossings were regularly empty because authorities directed asylum-seekers to larger cities.

“CBP’s own statistics show that the government has far more capacity to process asylum-seekers than it is currently using,” attorneys for the Southern Poverty Law Center, Center for Constitutional Rights, American Immigration Council and the Mayer Brown law firm wrote in a filing in federal court in San Diego.

Todd Owen, a senior CBP official overseeing ports of entry, said under oath in a deposition on Dec. 13 that the available of holding-cell space fluctuates according to the type of immigrants being held and whether they need to be isolated from others.

Owen said that processing immigrants was a lower priority than national security, counter-narcotics operations and regulating legitimate trade and travel.

During the surge, 2,000 CBP inspectors were reassigned to help the Border Patrol process people. Some Border Patrol stations were severely overcrowded with asylum-seekers, and several children died in government custody.

The analysis of the government figures was done by Stephanie Leutert, an expert on Mexico and Central America at the University of Texas Strauss Center for International Security and Law. She studied the data on behalf of attorneys seeking to block the metering policy.