After visiting a family detention center in Texas, U.S. Homeland Security Secretary Jeh Johnson announced Wednesday that families who enter the country illegally to seek asylum will no longer be detained after they’ve established legitimate claim for relief.

Heeding calls from Democrats to end the practice of detaining families, Johnson said that the Department of Homeland Security is making “substantial changes” to its detention practices so that families with children are not unnecessarily kept locked up.

“In short, once a family has established eligibility for asylum or other relief under our laws, long-term detention is an inefficient use of our resources and should be discontinued,” Johnson said in a statement.

The use of family detention centers has garnered national attention and controversy. Protesters have called for ending family detention after a surge of immigrants from Central America in mid-2014 — mostly adults with children, according to federal officials — prompted the Obama administration to increase its practice of detaining families in secure facilities.

The Texas Tribune thanks its sponsors. Become one.

Johnson’s announcement came after he visited a detention center in Karnes City, Texas — one of two family detainment facilities in Texas. The other facility in Texas, and the largest in the U.S, is the South Texas Family Residential Center in Dilley.

The Dilley detention center was built in December 2014 to host up to 2,400 undocumented women and children seeking asylum, and it was the site of of a large protest in May during which more than 500 protesters gathered to call for its closure.

Democrats and immigrant rights activists had criticized the use of family detention centers, saying the jail-like conditions were not appropriate for vulnerable women and children who were seeking relief. The feds had defended the use of family detention centers, calling them effective and humane alternatives to housing immigrant families.

But on Wednesday, Johnson said the family detention centers will only continue to be used to house families that have no legal claim to stay in the U.S.

The department will reform its policies so that families that have stated a credible or reasonable fear of persecution in their home countries will be released with “a reasonable and realistic” monetary bond.

Johnson said he is also directing U.S. Citizenship and Immigration Services to speed up interviews with detained families to reduce the time they spend in the detention facilities.

The Texas Tribune thanks its sponsors. Become one.

“In substance, the detention of families will be short term in most cases,” Johnson said.

In announcing the changes, Johnson said he was hopeful that Central American families would consider safe and lawful ways to migrate to the U.S.

“I have personally seen enough to know that the path of illegal migration from Central America to our southern border is a dangerous path and it is not for children,” Johnson said.