The acting head of the US Customs and Border Protection agency announced his resignation on Tuesday amid a public outcry over alarming detention conditions of migrant children in Texas.

John Sanders, appointed to the post just two months ago, said in a letter obtained by several US media outlets that he planned to step down as acting CBP commissioner on 5 July.

Mr Sanders' departure coincides with the revelation of unsanitary detention conditions for children at an overcrowded Border Patrol facility in Clint, Texas, a sign of the increasing strain on resources due to soaring numbers of arrests at the US-Mexico border.

AAP

The conditions at the centre in Clint were described by a team of lawyers, doctors and others who visited the facility about 30km southeast of El Paso.

Nearly 250 children were transferred out of Clint on Monday but a CBP official said on Tuesday that some 100 were being sent back there.

"The three-year-old before me had matted hair, a hacking cough, muddy pants, and eyes that fluttered closed with fatigue," wrote Clara Long, a researcher with Human Rights Watch who accompanied the team.

"His only caretaker for the last three weeks in a United States Border Patrol chain-link cage and then a cell... his 11-year old brother.

"Children at Clint told us they don't have regular access to showers or clean clothes, with some saying they hadn't been allowed to bathe over periods of weeks and don't have regular access to soap."

'Untenable position'

Mr Sanders has led CBP since April when President Donald Trump tapped CBP chief Kevin McAleenan to replace Kirstjen Nielsen as secretary of the Department of Homeland Security.

In a message to staff, Mr Sanders did not give a specific reason for quitting and officials told The Washington Post and The New York Times it was not clear if his resignation was directly related to the handling of underage migrants at the border.

READ MORE Mexico deploys 15,000 to halt US migration

Mr Trump told reporters on Tuesday he did not ask Mr Sanders to step down but "knew there were going to be changes there."

According to the Post, Mr Trump plans to name Mark Morgan, acting director of Immigration and Customs Enforcement (ICE), to replace Mr Sanders.

In an interview with CBS News on Tuesday, Mr Morgan said he does not believe there is a "systemic problem" at detention facilities.

"I just don't agree that it's egregious conditions, like a systemic problem," Mr Morgan said. "Are there issues that we can improve and get better? Absolutely."

US law requires unaccompanied minors to be returned to their parents or transferred to Health and Human Services facilities within 72 hours.

But many of the children held by the Border Patrol in Clint had been there for three or four weeks, according to the team which visited the facility on 17 June.

"The Border Patrol claims that high numbers of border arrivals are causing these delays as they wait for space to open up in the somewhat more child-friendly detention centres and shelters," said HRW's Long.

Arrivals of undocumented migrants at the southern US border have surged in recent months, with 144,000 taken into custody in May alone.

"Everybody understands it is not the Border Patrol's job to take care of children," said Warren Binford, a Willamette University law professor who visited the Clint facility.

"They are as upset as we are that these children are being put into their care because they don't have the ability to care for them," Mr Binford said on MSNBC.

"These children need to be with their families."

'Form of slavery'

Mr Trump asked about conditions at the detention centres, said he was "very concerned" and urged Democrats to approve $4.5 billion in emergency humanitarian funding for the southwest border.

He said "bad people" were using children to take advantage of lax US immigration laws.

"It's a form of slavery what they're doing to young children," he said.

Mr Trump also said Mexico "for the first time in 50 years is helping us" prevent border-crossing - after he threatened steep tariffs on Mexican goods unless it did more to slow migration.

Following a week of tense negotiations, Mexico agreed to reinforce its southern border with 6,000 National Guardsmen and expand its policy of taking back migrants while the US processes their asylum claims.

Mexico has also deployed 15,000 troops to the US border.

"They've done a great job," said Trump. "Hopefully they can keep it up."