A federal judge on Friday struck down a Trump administration policy that could have led to the detention of tens of thousands of refugees who are lawfully in the U.S. but have not yet received permanent residency.

U.S. District Judge Richard Stearns, who was nominated by former President Bill Clinton, granted six refugees and two groups serving refugees a partial summary judgment as well as class certification.

As part of his ruling, Stearns referenced a provision of the 1980 Refugee Act and found the government "has, historically, never interpreted the provision to authorize physical detention of a refugee pending adjustment of status." "The new policy adopted by the Government is contrary to law and must be vacated," Stearns wrote.