Walmart says it was "surprised and deeply disturbed" to learn that one of its former stores is now being used to house immigrant children separated from their parents.

The world's largest retailer is speaking out amid growing outrage over the former Walmart location in Brownsville, Texas, which the federal government is using to house roughly 1,500 immigrant boys between the ages of 10 to 17. Walmart has no role in the facility, and the company said it didn't know it would be used for this purpose when it sold the building in 2016.

Known as Casa Padre, the former Walmart is the biggest shelter facility for minors who are caught crossing the border illegally.

Get Breaking News Delivered to Your Inbox

A Walmart spokesman called the policy of separating immigrant children from their parents a "tragedy." The sale terms precluded the buyer, a developer, from using the building for certain purposes, although Walmart didn't specify that it couldn't be used as a facility to house migrant children.

"There was language that put limits on the use of the property," said Walmart spokesman Randy Hargrove. "It couldn't be for a billiards hall and not for adult entertainment," or competing businesses such as a grocery store.

Asked whether Walmart might change its sales contracts to prohibit its stores from being repurposed as detention centers, Hargrove said, "It's certainly something we'll look at."

A Walmart executive signed a document that indicated the buyer, a developer called Chacbak, was buying it with a loan from Southwest Key Programs, which is the organization that runs the shelter at the former store, according to The New York Times.

Hargrove said it's not standard practice to perform due diligence on the lender. "I can tell you we would not do due diligence on the lender for this type of thing."

After previously defending the policy, President Trump reversed course and signed an executive order on Wednesday to halt the practice of separating families at the U.S.-Mexico border.