A federal judge on Thursday released Kilmar Abrego Garcia from immigration custody, saying that the Trump administration had detained him for nearly four months “without lawful authority” despite repeated vows to re-expel him from the country.

The ruling by the judge, Paula Xinis, was a stinging defeat for the administration, which had often promised that Abrego Garcia would never walk free on U.S. soil. It was also the latest twist in a long and byzantine saga that, over the past year, transformed him from an unknown migrant living in Maryland who was wrongfully deported to El Salvador in March into one of the best-known symbols of President Donald Trump’s aggressive deportation agenda.

Xinis’ ruling, issued in U.S. District Court in Maryland, meant that Abrego Garcia would be both free from custody and, at least for now, out from under the immediate shadow of being deported from the country yet again.

But while the ruling was a stern rebuke of how Trump officials have handled his multiple, intersecting cases, it is unlikely to be the final word. The Justice Department is likely to appeal the decision, and administration officials could also seek to open a new immigration proceeding against him.

Moreover, Abrego Garcia is still facing separate criminal charges of smuggling immigrants who were in the U.S. illegally in a different court altogether in Nashville, Tennessee.

Still, Andrew Rossman, one of his lawyers, hailed Xinis’ ruling.