Texas is set to release more than 220 migrants who were arrested in Gov. Greg Abbott’s “catch and jail” border security policy and sat in prison for more than a month without being charged with a crime.

A state district judge granted a motion to release the men on no-cost bonds Tuesday morning after defense attorneys challenged the continued imprisonment of hundreds of migrants citing widespread violations of state law and constitutional rights to due process. Texas law requires criminal defendants be released from jail on no-cost or affordable bond if prosecutors delay cases by not filing charges quickly. For trespassing, the charge on which the vast majority of the migrants were arrested, that deadline is set at 15 or 30 days, depending on the charge level.

Kristen Etter, an attorney with Texas RioGrande Legal Aid, which represents the migrants, said at the hearing before state District Judge Roland Andrade that her organization had made an agreement with the Val Verde county attorney to release about 55 defendants arrested there who had been jailed without charges filed for more than 15 days as of Sept. 15. Kinney County prosecutors agreed to the release of another 168 defendants who had not had a charge filed against them in 30 days or more.

“I’m glad you all worked out most of these, and hopefully everything will be streamlined a little bit more,” Andrade said at the end of the hearing. “It’s a learning experience for everybody, even the court here.”

It’s unclear what will happen to the men when they are released from state custody. Federal immigration authorities may choose to take them into custody or deport them, or they may be released into the United States while awaiting their criminal and potential immigration proceedings.

Etter argued the men should be released after 15 days, as would apply to typical trespassing cases. Kinney County countered that the disaster declaration Abbott has called on the border enhances the cases to a higher level of misdemeanor, which would give officials 30 days to file charges.

The men were part of Abbott’s new policy to arrest migrants accused of crossing the border illegally on state charges, like trespassing, since state police and courts have no jurisdiction over federal immigration law. Abbott has blamed President Joe Biden’s immigration policies for a surge in border crossings this year.

The new system has had problems since arrests first began in July. Migrants have been wrongfully separated from their families during arrests, men whose criminal cases were dismissed have been released without any federal or state coordination into border towns without any documents, and the justice system has been in violation of state laws in its delays to file charges and appoint attorneys.

The 2021 Texas Tribune Festival, the weeklong celebration of politics and policy featuring big names and bold ideas, wrapped on Sept. 25, but there’s still time to tune in. Explore dozens of free, on-demand events before midnight Thursday, Sept. 30, at tribfest.org.

This article originally appeared in The Texas Tribune.

The Texas Tribune is a member-supported, nonpartisan newsroom informing and engaging Texans on state politics and policy. Learn more at texastribune.org.