A federal judge appeared to make a veiled criticism of the Trump administration’s immigration crackdown Thursday when he ruled that the government violated the constitutional rights of an asylum-seeker it has detained for nearly three years.

U.S. District Judge Alvin Hellerstein in New York granted a request for a bond hearing to Adou Kouadio, an asylum-seeker from the Ivory Coast who has been kept in immigration detention for 34 months. A hearing will allow Kouadio to seek release from detention while the government considers his asylum case.

Kouadio’s petition to the court said he was taken into custody after crossing the U.S. border in February 2016. He requested asylum and was found in a U.S. Citizenship and Immigration Services interview to have a “credible fear” of persecution in his country due to his political views. Yet his petition for asylum has been pending ever since. He argued that his indefinite detention without an opportunity for bail violated his right to “due process” under the Fifth Amendment.

The judge agreed.

Although the ruling was in a single case, Hellerstein seemed to make a broader critique of the Trump administration’s policy toward asylum-seekers. Noting that Kouadio had a “clean record” and had never been arrested, the judge said that holding the asylum-seeker in continued detention without a hearing violated his rights as a nonresident immigrant, “limited as those rights are.”

Hellerstein continued:

This nation prides itself on its humanity and openness with which it treats those who seek refuge at its gates. By contrast, the autocracies of the world have been marked by harsh regimes of exclusion and detention. Our notions of due process nourish the former spirit and brace us against the latter.

The judge added that 34 months of detention was “too long” without an opportunity for bail.

His right to liberty is as valuable to him as it is to any U.S. citizen. Judge Alvin Hellerstein

The decision comes amid the Trump administration’s broad crackdown on illegal immigration. The government has repeatedly sought to be able to detain undocumented immigrants for longer and deny them asylum in the U.S.

Thursday’s ruling was an “implicit criticism” of those policies, Stephen Legomsky, a professor at Washington University School of Law in St. Louis and former chief counsel for U.S. Citizenship and Immigration Services under the Obama administration, told The New York Times. “It is a clear rejection of the administration’s preference for long-term detention of asylum seekers.”

Just last month, President Donald Trump issued a new interim rule and presidential proclamation to deny asylum to immigrants who crossed the border illegally rather than at a port of entry, regardless of whether they otherwise had a valid claim to asylum. After immigration rights groups sued, the Supreme Court ruled last week against the Trump administration’s restrictions.

In February, the Supreme Court curbed detained immigrants’ rights to bond hearings, overturning a lower court’s ruling that required that detained immigrants awaiting the outcome of deportation proceedings get a bond hearing after six months of detention. But the Supreme Court did not rule on whether the Constitution required such hearings, sending the case back to a lower court to consider that issue, according to The New York Times.

In his ruling Thursday, the judge noted there was “little risk of flight,” since Kouadio was seeking asylum in the U.S., and “little risk of danger to the community,” given his lack of criminal history.

“Yet, [Kouadio] has suffered 34 months of detention without an opportunity for a bond hearing,” the judge wrote. He ordered that Kouadio be given a bond hearing within two weeks.

“His right to liberty is as valuable to him as it is to any U.S. citizen,” he wrote.