Updated

Texas won’t allow schools to use state funding to educate immigrant children while they are being housed in federal detention – something that would have cost millions, the Texas Education Agency (TEA) said.

The education agency told Austin-based charter school group Southwest Key, Promesa Public Schools, that local schools that want to serve migrant students in federal custody can’t “do so with state education funding,” The Houston Chronicle reported.

Southwest Key, one of the largest nonprofits operating shelters for migrant children in Texas, said the agency’s stance jeopardizes partnerships the shelters have formed with at least two traditional school districts, one of which would have funneled millions of Texas tax dollars.

Southwest key programs

Southwest Key-Nueva Esperanza, located in Brownsville, Texas, is a facility that shelters unaccompanied immigrant children. (AP Photo/Eric Gay)

"I think the ones that ultimately are affected adversely are the youth that are in the shelters," Salvador Cavazos, the nonprofit's vice president for education services told the paper. "Because we're in a partnership, we would have been able to provide additional resources, partner with credit-bearing institutions, provide grades and help them achieve credits go to other public schools."

Texas officials say it falls under the legal obligation of the federal government to educate the migrant children.

This comes amid the debate of what to do with minors who cross the border illegally.

U.S. Immigration and Customs Enforcement requires school-age children in shelters to receive at least six hours of structured education during the week.

Texas officials say schools still could voluntarily provide help to shelters. But school leaders across the state say their schools have been dealing with declining state funding for years, which makes it impractical to pay to provide services to students who aren't technically enrolled in their districts.

President Trump signed an executive order that stopped family separations at the border in June.

The Supreme Court has previously ruled that all children – regardless of immigration status – are entitled to a public education.

The Associated Press contributed to this report.