Federal border officials might have spoken too soon when they predicted earlier this year that the level of illegal immigration to the U.S. among mothers and children would decrease. There was actually a surge of immigrant families crossing U.S. borders last month, a top Department of Homeland Security official told a federal court Thursday.

The new wave of arrivals comes as Border Patrol officials continue to wrestle with conditions at detention facilities overcrowded with Central American children and adults fleeing their homelands for the U.S. During the court hearing Thursday, Obama administration officials were seeking a compromise from a federal judge who recently limited how officials detain immigrant families.

Ronald Vitiello, the deputy Border Patrol chief, said the number of immigrant families captured at the border increased in July, bucking a downward trend that officials had counted on to address the problems at detention centers. He filed papers in federal court arguing that limiting detention puts strains on Border Patrol outposts, the Washington Times reported.

“This would greatly impact our operational capacity and our ability to secure the borders while facilitating lawful trade and travel,” Vitiello said in an affidavit filed with the court.

Homeland Security, the agency that enforces U.S. immigration law, has faced an onslaught of criticism in recent months from immigrant rights advocates over the safety and poor living conditions of migrant children who arrived to the country in droves last year.

U.S. District Judge Dolly Gee of California, ruled July 24 that two detention centers in Texas had failed to meet the standards and conditions required by a 1997 class-action settlement that ordered Border Patrol agents to release immigrant children to a parent, legal guardian or close relative instead of detaining them.

Gee said the settlement applies to minors who arrived with adults, too, and ordered children and mothers released as quickly as possible. But Obama administration officials have warned that as a result of the ruling, foreigners with children will realize they can’t be detained and will continue flooding over the border.

“Specifically, the proposed remedies could heighten the risk of another surge in illegal migration across our Southwest border by Central American families, including by incentivizing adults to bring children with them on their dangerous journey as a means to avoid detention and gain access to the interior of the United States,” Benjamin Mizer, a deputy assistant U.S. attorney general, wrote in court papers filed Thursday.