WASHINGTON — The Supreme Court is allowing nationwide enforcement of a new Trump administration rule that prevents most Central American immigrants from seeking asylum in the United States.

The justices’ order late Wednesday temporarily undoes a lower-court ruling that had blocked the new asylum policy in some states along the southern border. The policy is meant to deny asylum to anyone who passes through another country on the way to the U.S. without seeking protection there.

Most people crossing the southern border are Central Americans fleeing violence and poverty. They are largely ineligible under the new rule, as are asylum seekers from Africa, Asia and South America who arrive regularly at the southern border.

The shift reverses decades of U.S. policy. The administration has said that it wants to close the gap between an initial asylum screening that most people pass and a final decision on asylum that most people do not win.

“BIG United States Supreme Court WIN for the Border on Asylum!” Trump tweeted.

Justices Ruth Bader Ginsburg and Sonia Sotomayor dissented from the high-court’s order. “Once again, the Executive Branch has issued a rule that seeks to upend longstanding practices regarding refugees who seek shelter from persecution,” Sotomayor wrote.

The legal challenge to the new policy has a brief but somewhat convoluted history. U.S. District Judge Jon Tigar in San Francisco blocked the new policy from taking effect in late July. A three-judge panel of the 9th U.S. Circuit Court of Appeals narrowed Tigar’s order so that it applied only in Arizona and California, states that are within the 9th Circuit.

That left the administration free to enforce the policy on asylum seekers arriving in New Mexico and Texas. Tigar issued a new order on Monday that reimposed a nationwide hold on asylum policy. The 9th Circuit again narrowed his order on Tuesday.

The high-court action allows the administration to impose the new policy everywhere while the court case against it continues.

Lee Gelernt, the American Civil Liberties Union lawyer who is representing immigrant advocacy groups in the case, said: “This is just a temporary step, and we’re hopeful we’ll prevail at the end of the day. The lives of thousands of families are at stake.”