Washington — 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 decision from Sessions stemmed from a case involving a woman from El Salvador whose asylum status was upheld in 2016, based on claims she was a victim of domestic violence. The new restrictions were denounced by immigration advocates, and the American Civil Liberties Union sued the government over the policy.

Get Breaking News Delivered to Your Inbox

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.

In 2014, the Board of Immigration Appeals ruled that domestic violence could be used as the basis of an asylum claim. Asylum can also be granted the on grounds of persecution based on race, religion, nationality, political affiliation or membership in a social group.