A New Jersey appeals court has ruled in a precedential decision that state courts cannot order criminally charged immigrants facing deportation to be detained in state custody to ensure that they are not removed from the country by federal immigration authorities before trial.

The Appellate Division’s ruling, which examines the state bail reform law’s interaction with federal immigration law, comes in the consolidated appeals of defendants Juan Molchor and Jose Rios, who were arrested and charged with second-degree assault after allegedly smashing bottles over an acquaintance’s head at a party.