WASHINGTON (Reuters) - A federal judge ordered the Department of Homeland Security to set aside a plan that would make more people vulnerable to expedited deportation until a court can rule on the matter.

The lawsuit, filed by WeCount! and other immigration advocates, asked a Washington court to overturn a plan making undocumented people eligible for deportation without court oversight unless they could prove they had been in the country more than two years.

Judge Ketanji Brown Jackson of the U.S. District Court for the District of Columbia granted a preliminary injunction on Friday, setting aside the rule until it can be litigated, saying that the people represented by the immigration advocates “would be irreparably harmed by the challenged agency action.”

Previously, only those immigrants detained within 100 miles (161 kilometers) of the border who had been in the country two weeks or less could be ordered rapidly deported. The policy makes an exception for immigrants who can establish a “credible fear” of persecution in their home country.

The U.S. Justice Department said in an email statement that the decision “undermines the laws enacted by Congress and the Trump Administration’s careful efforts to implement those laws.”

“Congress expressly authorized the Secretary of Homeland Security to act with dispatch to remove from the country aliens who have no right to be here,” a department spokesman said, adding that granting the preliminary injunction “vastly exceeds the district court’s own authority.”

Also on Friday, a federal judge in California blocked a Trump administration rule that would have allowed indefinite detention of migrant families, saying it was inconsistent with a decades-old court settlement that governs conditions for migrant children in U.S. custody.