Editor's note: This story has been updated with additional comment and a clarification is appended.

A nonprofit organization has sued the Texas Department of Family and Protective Services for issuing a temporary child-care license to an immigration detention facility in Karnes City.

Grassroots Leadership, which opposes for-profit prisons, says the department has no authority to regulate detention centers or prisons and is asking Travis County District Court for a temporary injunction and restraining order to stop the licensing. 

"We think both that it is inappropriate and wrong for the state agency to license prisons as childcare facilities," said Bob Libal, executive director of the organization. "They're saying these are child facilities now, after more than a decade of saying that there weren't child care facilities in the detention centers, essentially to help the federal government avoid a lawsuit and to help the federal government enforce harsh immigration policies against children and their moms."

The Texas Tribune thanks its sponsors. Become one.

A federal district judge ruled last year that the nearly 2,000 women and children in the Karnes center and a similar facility in Dilley were being held in "deplorable conditions" that violated part of a 1997 settlement called the Flores v. Meese agreement that required undocumented children to be held in places that protect their overall well being. The judge ruled families held in violating facilities should be released as soon as possible. The government has appealed to the U.S. 9th Circuit Court of Appeals.

Both the Karnes and Dilley centers house women and children who arrived in the state during a surge of unauthorized migration last summer in the Rio Grande Valley. 

Jonathan Ryan, the executive director of RAICES, the Refugee and Immigrant Center for Education and Legal Services, said the news of the childcare licenses "came as a disappointment, but unfortunately not a surprise."

"The public voice has been strong against these prisons and against licensing them as childcare facilities, yet the march of the government was steady in the direction of licensing from the get-go," Ryan said.

Ryan said if detention centers have childcare licenses, it will allow them to detain children for longer stretches of time and allow the government to separate children from their mothers. 

Patrick Crimmins, a spokesman for the department, said the Karnes and Dilley facilities were each issued daycare permits — unrelated to the childcare licenses in dispute — in 2015 so employees could watch children if their mothers have medical appointments or court appearances. He said issuing broader childcare licenses for the facilities allows the state to conduct regular inspections and "investigate allegations of abuse and neglect in the facility."

The Texas Tribune thanks its sponsors. Become one.

Documents from the department show that a March inspection of the Karnes center, operated by the GEO Group, uncovered six deficiencies ranging from insufficient mulch levels on the playground to unclear labeling of children's' allergies and health conditions in their files.

The department has also made headway on issuing a childcare license to the center in Dilley, operated by the Corrections Corporation of America, but the facility must first address 12 deficiencies discovered in a department inspection. The report found that medical treatment rooms at the Dilley center had unsecured medications and supplies such as scalpels and syringes, while the kitchen had expired juices and unrefrigerated apples.

Following the federal judge's ruling, the department announced plans to license the facilities using emergency rules that would allow them to bypass a requirement for members of the public to speak on licensing issues. In November, state District Judge Karin Crump of Travis County determined emergency rules were unnecessary as "no imminent peril to public health, safety or welfare exists" in the facilities. The department pursued the standard process and heard four hours of public testimony in December on the potential licensing of the Karnes and Dilley centers.

Crimmins said the department will conduct at least three unannounced inspections of the Karnes facility and the center must address any problems noted on these visits. If all identified issues are addressed at the end of the six-month period, the center will receive a permanent license.

Clarification: This story has been revised to emphasize that the daycare permits issued to the facilities in 2015 are distinct from the childcare licenses in dispute.

Never miss a moment in Texas politics with our daily newsletter.