SAN DIEGO (AP) — More than 16,000 families were apprehended at the border in August, authorities said Wednesday, a dramatic increase from previous months that the Trump administration blamed on legal loopholes and a reversal of a widely denounced policy that separated parents and children at the border.

The number of family arrivals reached 15,955, a sharp increase from July that Customs and Border Protection Commissioner Kevin McAleenan said was one of the highest on record. Families accounted for more than one-third people who were stopped at the border.

He called the increase "a direct response to gaps in the legal framework," adding, "we're not surprised by it, but it's been a very stark trend."

Overall, people arrested or stopped at the border totaled 46,560, up 17 percent from 39,953 in July and up 52 percent from 30,567 in August 2017. Arrests have risen from July to August in four of the previous five years, indicating seasonal factors may be an influence.

The number of people arriving as families increased 30 percent from July to August, outpacing the overall increase.

The numbers offer a glimpse into the impact of the Trump administration's "zero tolerance" policy on illegal crossings introduced in April, which resulted in the separation of more than 2,500 children from their parents. President Donald

Trump effectively ended the practice of separating families in June amid heavy criticism.

With the midterm elections looming and immigration a key issue in congressional races across the country, McAleenan, a Trump appointee, called the situation "a crisis of significant proportions from a humanitarian perspective and a security perspective."

The arrest tally is also the latest reminder of how border crossings have shifted over the last decade from predominantly Mexican men to Central American families and children.

The Border Patrol, which polices official ports of entry, made 37,544 arrests in August, including 12,774 of people who came as families and 4,396 children traveling alone.

Another 9,016 were stopped elsewhere, including 3,181 who came as families and 376 as unaccompanied children.

Last week, the Trump administration moved to abandon a longstanding court settlement that limits how long immigrant children can be kept locked up, proposing new regulations that would allow the government to detain families until their immigration cases are decided.

Administration officials said that ending the so-called Flores agreement of 1997 will speed up the handling of asylum requests while also deterring people from illegally crossing the border.

The move angered immigrant rights advocates and is all but certain to trigger a court battle.

Border arrests are an imperfect gauge of illegal crossings because they don't indicate how many people got away.

Trump touted border arrests when they fell sharply during his first few months in office to less than 16,000 in April 2017. The arrest tally rose in 11 of the following 12 months, topping 50,000 in March, April and May of this year.

The administration said Tuesday that it will expand its tent shelter for immigrant minors crossing the border to 3,800 beds and keep it open through the end of this year. The facility at Tornillo, Texas, which originally opened with a 360-bed capacity for 30 days, is being expanded based on how many children are in the care of the U.S. Department of Health and Human Services.