SAN DIEGO — A federal judge has blocked the Trump administration's move to vastly extend authority of immigration officers to deport people without allowing them to appear before judges, the third legal setback for its immigration agenda in one day.

The policy, which was announced in July but hasn't yet been enforced, would allow fast-track deportations to apply to anyone in the country illegally for less than two years. Now, they are largely limited to people arrested almost immediately after crossing the Mexican border.

U.S. District Judge Ketanji Brown Jackson, ruling late Friday in Washington, said the administration's expansion of "expedited removal" authority violated procedural requirements to first seek public comment and ignored flaws in how it has been used on a smaller scale at the border.

A group of Central American migrants walk next to the U.S.-Mexico border fence after they crossed the borderline in El Paso, Texas,in May. Jose Luis Gonzalez / Reuters file

The shortcomings, which were not challenged by government lawyers, include allegations that some people entitled to be in the country were targeted for deportation, translators weren't provided, and authorities made "egregious errors" recording statements of migrants who said they feared persecution or torture if sent back to their homelands.

"With respect to the policy at issue here, the potential devastation is so obvious that (the Department of Homeland Security) can be fairly faulted for its unexplained failure to predict, and attempt to mitigate, the fully foreseeable future floods," Jackson wrote.

Jackson, an appointee of President Barack Obama, hasn't ruled on merits of the case, but her decision prevents the administration from expanding fast-track authority nationwide while the lawsuit proceeds.

Earlier Friday, a federal judge in Los Angeles blocked new rules that would allow the government to detain immigrant children with their parents indefinitely, saying the move conflicted with a 1997 settlement agreement that requires the release of children caught on the border as quickly as possible to relatives in the U.S. and says they can only be held in facilities licensed by a state. The Flores agreement — named for a teenage plaintiff — will remain in place and govern conditions for children in custody, including those with their parents.

Also Friday, another federal judge in Los Angeles blocked U.S. Immigration and Customs Enforcement from relying solely on flawed databases to target people for being in the country illegally. The decision affects detainers issued by an ICE officer in the federal court system's Central District of California.

U.S. Border Patrol agents speak with a mother and daughter from Ecuador next to the border fence after detaining them in Penitas, Texas on Sept. 10, 2019. John Moore / Getty Images

The fast-track deportation powers were created under a 1996 law but didn't become a major piece of border enforcement until 2004, when Homeland Security said it would be enforced for people who are arrested within two weeks of entering the U.S. by land and caught within 100 miles of the border. Defenders say it relieves burdens on immigration judges — their backlog of cases recently topped 1 million — while critics say it grants too much power to Border Patrol agents and other immigration enforcement officials and jeopardizes rights to fair treatment.

Keven McAleenan, the acting Homeland Security secretary, said in July that U.S. authorities don't have space to detain "the vast majority" of people arrested on the border, leading to the release of hundreds of thousands with notices to appear in court. He said expanded authority would likely cause illegal entries to decline and result in people getting more quickly removed from the country than in immigration courts, where cases can take years to resolve.

The Justice Department said Saturday that the judge overstepped her authority and undermined laws enacted by Congress with careful consideration by the administration on how to enforce them. The White House echoed that view in a statement and added that the administration has been trying since its inception to enforce immigration laws and that "misguided lower court decisions have been preventing those laws from ever being enforced_at immense cost to the whole country."

Migrants who crossed illegally into El Paso, Texas, turn themselves in to ask for asylum on July 31, 2019. \ Jose Luis Gonzalez / Reuters file

The potential impact of expanding fast-track powers is difficult to predict. McAleenan said in July that 20,570 people arrested in the nation's interior from October 2017 through September 2018 had been in the U.S. less than two years, which would make them subject to the new rule. Critics say the impact could be more far-reaching because many in the U.S for longer than two years may be unable to prove they have been in the country that long.

"The court rejected the Trump administration's illegal attempt to remove hundreds of thousands of people from the U.S. without any legal recourse," said American Civil Liberties Union attorney Anand Balakrishnan, who argued the case on behalf of Make the Road New York and other advocacy groups. "This ruling recognizes the irreparable harm of this policy."

The administration's setbacks followed two recent victories for its immigration policies at the Supreme Court, one allowing diversion of Defense Department money to build a border wall and another denying asylum to anyone who enters the country at the Mexican border after passing through another country and not applying there.