BOSTON (Reuters) - A federal judge on Wednesday declined to dismiss a lawsuit by an Indonesian illegal immigrant challenging his detention in a Massachusetts county jail, finding that she had authority to challenge the conditions of his confinement.

Terry Rombot was part of a wave of Indonesian Christians who fled their country following deadly riots in 1998. About 70 members of that exodus have been allowed to remain, illegally, in New Hampshire since 2010 under a deal with U.S. Immigration and Customs Enforcement (ICE) authorities.

However, in August, President Donald Trump instructed ICE in a directive that all immigrants in the United States illegally were subject to deportation. Rombot learned of the policy change when he arrived for an Aug. 1 check-in at ICE’s Manchester, New Hampshire, office and was arrested.

He was initially held in Massachusetts at the Plymouth County house of corrections, which had filed a bid to dismiss the lawsuit, and since has been moved to Bristol County.

Federal courts do not have direct authority over immigration matters, which are handled by the Executive Office for Immigration Review, but Chief Judge Patti Saris of the U.S. District Court in Boston wrote in a court filing on Wednesday that she has a say over the terms of his confinement.

“The district court holds jurisdiction to review habeas (corpus) challenges to unlawful immigration detention,” Saris wrote. Writs of habeas corpus challenge illegal detention.

At a Friday hearing, Saris expressed concern that ICE had broken its word with Rombot after telling him in 2015 that he would “be given an opportunity to prepare for an orderly departure” before being deported. She also expressed concern he was being held alongside potentially violent criminals.

Rombot is one of 47 Indonesian nationals living illegally in New Hampshire involved in a lawsuit challenging the Trump administration’s move to deport them.

ICE officials said the arrangement had always been a temporary one and that the agency always had discretion to deport the people covered by the arrangement.

Members of the group and advocates say they fear they could face discrimination or violence if forced to return to the world’s largest Muslim-majority country.

The Indonesians are part of an ethnic community of about 2,000 people clustered around the city of Dover in New Hampshire’s seacoast region. Their cause has drawn the support of the state’s all-Democratic congressional delegation, including U.S. Senator Jeanne Shaheen and Republican Governor Chris Sununu.