A Texas federal judge has denied Minnesota’s request to compel the extradition of an ICE agent charged in connection with a shooting that wounded a Venezuelan man in Minneapolis.

The ruling, handed down on Wednesday, opens the door for Christian Castro’s release from the jail in Brownsville, Texas, on Thursday, when the 90-day clock on his detention expires, as prescribed by state law.

Cameron County Sheriff Manuel Treviño confirmed to ABC affiliate KRGV-TV that Castro will be released at midnight Thursday morning.

Castro was arrested in Harlingen, Texas, on May 29 on a warrant charging him with four felony counts of second-degree assault with a dangerous weapon and a misdemeanor count of falsely reporting a crime.

Minnesota Gov. Tim Walz asked Texas Gov. Greg Abbott to facilitate Castro’s extradition shortly afterward, and with less than two weeks left before Castro’s impending release, Minnesota Attorney General Keith Ellison filed a lawsuit asking the court to intervene, either by compelling Abbott to sign the rendition warrant or barring Cameron County Sheriff Manuel Treviño from releasing Castro from custody.

U.S. District Judge Fernando Rodriguez Jr., a Trump appointee in the Southern District of Texas, wrote that Minnesota had failed to demonstrate that any harm had occurred given that Abbott had neither denied or approved the warrant and Castro had yet to be released.

He also sympathized with Texas’ argument that it had not yet completed its investigation into whether Castro qualified as a refugee because his relocation to Texas was ordered as a condition of his employment.

While Rodriguez acknowledged Castro’s potential flight to Mexico “would impose a hardship on Minnesota’s prosecutorial efforts,” as Ellison had argued in court, he said that possibility “does not alter the analysis” that Minnesota had not demonstrated “a substantial likelihood of success on the merits of at least one of its causes of action.”

In a statement, Ellison said Abbott “is playing with constitutional fire” and “is turning Texas into a sanctuary state for violent criminals.”

“We will continue litigating this case and do everything in our power to ensure Castro is returned to Minnesota to face his criminal charges,” Ellison said.

Castro is accused of shooting at Julio Sosa-Celis through the door of a north Minneapolis home on Jan. 14 in the course of his duties as a U.S. Immigration and Customs Enforcement officer during Operation Metro Surge.

He had initially told FBI investigators that Sosa-Celis and others had attacked him, using a snow shovel and a broom handle as weapons. Video evidence of the shooting contradicted his sworn statement, and Castro was placed on leave as the U.S. Department of Justice investigated whether he lied under oath.

For Related Stories: Christian Castro  ICE  Texas