Credit: Dreamstime | TNS

BOSTON — A federal judge has ruled that detaining certain immigrants by default during immigration court proceedings is unconstitutional.

U.S. District Court Judge Patti Saris said in a Wednesday decision that asking someone living in in the country illegally to prove they’re not a flight risk or threat before releasing them on bond violates their due process rights.

She said the burden of proof should be on the government, as it is in criminal court.

Saris said the Boston immigration court, which serves Maine, New Hampshire, Vermont, Massachusetts and Rhode Island, must change its proceedings by Dec. 13.

The American Civil Liberties Union filed the class-action lawsuit in June on behalf of three immigrants detained after having to prove they weren’t a flight risk.

An ICE spokesman declined to comment, saying the litigation is ongoing.