The Trump administration is threatening to move swiftly to impose a near-total block on Central Americans seeking asylum at the US-Mexico border after the US supreme court gave its temporary blessing to a nationwide clampdown that effectively ends America’s status as a safe haven for those fleeing persecution.

In an order issued on Wednesday night, the court gave the Trump administration policy the green light to turn away those asylum seekers who have passed through a third country before reaching the southern border.

The shift will affect virtually all of the thousands of families from El Salvador, Guatemala and Honduras who pass through Mexico on the perilous journey north.

Within hours of the ruling, senior administration figures said they would move instantly to implement the changes. Ken Cuccinelli, acting director of US Citizenship and Immigration Services (USCIS), said the agency “will commence implementing the asylum rule asap”.

Donald Trump bragged in a tweet that the ruling was a “BIG … WIN for the Border on Asylum!”

The likelihood of a further tightening of the US government’s stranglehold on asylum seekers at the US border comes as the number of Central Americans crossing into the country has already steadily declined in recent months. Much of the reduction has come from increased interception by the Mexican government under threat of reprisals from Washington.

The Mexican president, Andrés Manuel López Obrador, has been careful to placate Trump after the US president threatened to close the border entirely earlier this year. Mexico’s foreign minister, Marcelo Ebrard, responded to the supreme court order on Thursday, saying that “we obviously don’t agree with it, we have a different policy”.

But there was no indication that Mexico would try to resist the change, even though it could have severe implications on its side of the territorial divide. There are thought to be at least 45,000 Central Americans who have been turned away by US agents and forced to wait within Mexico while their asylum claims are processed, which can take many months.

The supreme court’s order will apply temporarily. The issue of whether asylum claims should be accepted from those who have passed through third countries has led to conflicting rulings in lower courts, and those legal disparities are still working their way through the system.

The issue is almost certain to rise up the legal food chain once again until it returns to the supreme court for a full hearing that would settle the question once and for all.

But until the law is settled, the rule change will effectively put on ice decades of procedure whereby America prided itself as a safe haven for those who had fled persecution. Refugees have been able to turn up at the US border and make a “credible fear” claim that they faced danger back at home.

Now, under the new rule families, including children, who have passed through Mexico can be deported immediately back to their native countries without any thought being paid to the risks they might face on their return.

The news provoked an outpouring of criticism, even from within the supreme court itself. Justice Sonia Sotomayor wrote a dissenting opinion that was joined by Justice Ruth Bader Ginsburg in which the justice said the rule upended “longstanding practices regarding refugees who seek shelter from persecution”.

Sotomayor added: “The rule the government promulgated topples decades of settled asylum practices and affects some of the most vulnerable people in the western hemisphere.”

Jess Morales Rocketto, chair of a coalition of groups opposing the immigration crackdown, said: “The Trump administration has put babies in cages, ripped thousands of children away from their parents, banned Muslims from this country because of their religion, started concentration camps, and now they are closing the doors of America to Central American refugees. All parents want freedom and opportunity for their children. But when it comes to the American dream, Trump and his Republican allies are saying: ‘Latinos need not apply.’”

Trump continues to make his hardline approach to immigration a central facet of his presidency, and he is likely to make the subject a mainstay of his bid for re-election next year. This month he snatched $3.6bn from the Pentagon’s budget to fund his controversial border wall.

Recently the Trump administration also ran roughshod over a court agreement that had spared migrant families, including children, from being detained for more than 20 days. The change is facing several legal challenges, but unless it is overturned it is likely to see a dramatic increase in families being held indefinitely in secure facilities that have been likened to prisons.