Roberto Orozco-Ramirez walked out of the Cascade County Detention Center in Great Falls on Thursday morning after a federal judge ordered his release from custody, siding with his lawyers that his continued detention was unlawful. He embraced his oldest son, and both wiped tears from their eyes before driving back toward Froid, where his community had planned to celebrate his return.

In a ruling issued Wednesday evening, U.S. District Court for the District of Montana Chief Judge Brian Morris ordered that the undocumented mechanic—who had been detained since January—be released within 24 hours. Orozco-Ramirez then left the facility around 10:50 a.m. Thursday, according to the report, following more than 100 days behind bars.

Morris wrote that the Trump administration’s interpretation of the immigration law at issue was “erroneous.” In the same ruling, he said people accused of entering the country illegally have a right to due process and warned that executive-branch “indifference” to the Constitution’s guarantee of freedom from arbitrary confinement raised “grave cause for concern,” the report said.

Orozco-Ramirez told those gathered that he needed to go home and that it had been a long time. His lawyer, Laura Christoffersen, told the court that she was celebrating the decision, and she said in a quoted statement that “a person, alien or not, cannot be deprived of his liberty without the right to be heard or statutory procedures followed.”

Christoffersen also tied support for Orozco-Ramirez’s fight to his hometown, saying the credit belonged to “the good people of Froid” who, she said, raised money in a couple of days to find an expert in immigration law. The report said residents raised tens of thousands of dollars for Orozco-Ramirez’s legal fund and family since his arrest.

The case drew attention beyond Montana after Border Patrol arrested Orozco-Ramirez on Jan. 25. The report said his January arrest shocked the small northeast Montana town of Froid, which has a population of 195, and became a focal point for supporters who traveled to court hearings and organized online discussion after his detention continued even after criminal charges were dropped.

The report said Orozco-Ramirez had initially been charged in federal court with illegal re-entry and that the government dropped the felony charge on April 13. In the days that followed, his lawyers filed a civil lawsuit challenging his continued detention, naming various law enforcement and federal entities, including the Cascade County Detention Center and U.S. Customs and Immigration Enforcement, according to the report.

A key issue in the litigation centered on the Trump administration’s legal approach to detention, including a new interpretation that, the report said, expanded the criteria for when ICE considers immigrants eligible for mandatory detention. The report said that under previous guidance, undocumented immigrants who had been living in the U.S. long term without a criminal history were eligible for bond, while the newer guidance subjected those who entered illegally to mandatory detention and not to bond.

The report said Orozco-Ramirez’s detention also played out against a patchwork of court decisions in other states, including appeals-court rulings based in New York, Georgia and Ohio that had rejected the administration’s no-bond policy and rulings in Louisiana and Missouri that had sided with the administration. It said judges in Montana had not weighed in on the precise question before Wednesday’s ruling.

At a hearing earlier this week, the report said about 50 people filled a Great Falls federal courthouse, many driving roughly seven hours from Froid to attend. The report also said Orozco-Ramirez’s four sons sat in the front row, with classmates and local supporters nearby, after which news of his release spread on social media Thursday and prompted both celebration and criticism.

In an emailed statement quoted in the report, a lawyer for Orozco-Ramirez, Johnny Sinodis, said he was happy the mechanic could reunite with his family and described other detained immigrants, writing that “countless other productive and well-respected individuals throughout the country are being subjected to unlawful physical confinement in immigration jails for no other reason but to appease the administration.”

A lawyer for the U.S. attorney’s office for the District of Montana, Randy Tanner, told the court in an appearance connected to the case that his office was reviewing the judge’s order and would not comment on the ruling, according to the report.