The Trump administration has told operators of shelters for immigrant children to cut back on or end education, legal services and recreation, citing funding problems as it has taken more children into custody.

The administration said the directive was necessary because of a spike in the number of children in its custody. The Department of Health and Human Services (HHS) said that it is required by law to take certain actions to avoid deficiency in funding — including cutting resources to other programs.

“Additional resources are urgently required to meet the humanitarian needs created by this influx — to both sustain critical child welfare and release operations and increase capacity,” Evelyn Stauffer, spokeswoman for the Administration of Children and Families at HHS, said in a statement to NBC News.

The request could violate federal law dictating conditions for holding immigrant children in government custody. A longstanding U.S. Supreme Court ruling dictates that immigrant children in the United States have a right to education.

The move was widely denounced by humanitarian and advocacy organizations.

“It’s bad enough that the Trump administration is trying to normalize the warehousing of children," Denise Bell, a researcher with Amnesty International, said in a statement to NBC News. "It’s unconscionable that they would so blatantly try to strip them of their rights."

Wendy Young, president of Kids in Need of Defense, which advocates for immigrant children, also criticized the directive. She said she was aware the agency was facing a funding deficit “because the numbers continue to pick up and so many policy changes have been made, so kids are staying in custody longer and bed space is not freeing up quickly.”

She said that education and recreation are essential services for the children and legal services are a lifeline. Having a lawyer to argue a child's case in court may be the determining factor in whether they can return to their home country safely or be protected by remaining in the United States.

Ending legal services will leave many children to go through asylum proceedings with no lawyer, she said.

“Last month we represented a six-month old child,” Young said.

Domingo Garcia, president of League of United Latin American Citizens, told NBC News his group received a call from a shelter worker concerned about how cuts to the services will affect the children and also concerned about jobs of workers.

Garcia said it would be devastating for children to have no chance for outside activities and the equivalent of child neglect.

News of the directive comes after NBC News reported Wednesday that children have been sleeping on concrete benches or outside Border Patrol Stations as Health and Human Services’ shelters are nearing or at capacity.

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.