WASHINGTON (AP) — A federal judge has blocked restrictive Trump administration policies that prevented some immigrants from seeking asylum due to domestic and gang violence in their home countries.

U.S. District Court Judge Emmet Sullivan ruled on Wednesday that some of the guidance that then-Attorney General Jeff Sessions issued this year cannot be used to determine whether an immigrant has a credible fear of persecution or torture in his or her home country. That’s the first step to making an asylum claim in the U.S.

The American Civil Liberties Union sued the government over the policy.

The ruling applies to immigrants in expedited removal proceedings. The judge also ordered the government to return any of the deported plaintiffs back to the U.S. and prevent their deportation.