The U.S. Supreme Court on Wednesday ordered a Trump administration policy requiring asylum seekers to wait in Mexico for the outcome of their case to remain in effect while a lower court challenge plays out. The order, which was brief and unsigned, stayed an earlier ruling by the U.S. Court of Appeals for the Ninth Circuit in San Francisco, which would have abruptly halted the administration’s so-called “Remain in Mexico” program.

The appeals court ruled last month the program was legally invalid, and its order would have applied to the two states within its jurisdiction, California and Arizona, beginning Thursday. The administration argued, quite rightly, that the appeals court’s ruling was “virtually assured to cause chaos at the border” by prompting thousands of migrants to cross into the United States, potentially overwhelming U.S. border facilities.

This isn’t the first time a lower court has tried to short-circuit the administration’s efforts to reform federal asylum policy. Last year the Supreme Court sided with the Trump administration on a similar border issue, clearing the way for the enforcement of a new rule that requires any non-Mexican claiming asylum at the southwest border to first seek asylum in one of the countries he or she passed through en route to the United States.

In this case, the Supreme Court has correctly ruled that the administration’s policy can stay in place while a legal challenge to it plays out in federal court.

Whatever one thinks of these programs and policies, there’s no question that federal law allows the executive branch broad leeway in devising policies for border control, asylum, and immigration enforcement. That’s how the Obama administration was able to create programs like Deferred Action for Childhood Arrivals, or DACA—in fact, Obama went further than Trump in the exercise of executive powers, attempting to expand DACA to some five million illegal immigrants, a move federal courts blocked.

What Trump has tried to do with Remain in Mexico is far more limited. Under the program, formally known as the Migrant Protection Protocols, some 60,000 asylum seekers, mostly Central Americans, have been forced to wait in Mexico while their asylum claims make their way through U.S. immigration courts. It was instituted last year as a way to end what the Trump administration calls “catch and release,” whereby those crossing the border illegally and then claiming asylum are simply released into the United States with orders to appear before an immigration judge at a later date.

Amid a surge of asylum claims last year, combined with concerns that asylum seekers could, once released, simply abscond before the end of their cases, the administration created the Remain in Mexico policy.

Critics say migrants returning to Mexico are in danger of being targeted for kidnapping, extortion, or violence, and that the program amounts to a violation of U.S. and international laws against “refoulement,” or the practice of returning asylum seekers to countries where they face persecution. And it’s of course true that Mexico is a dangerous place, especially for migrants.

That is to say, Remain in Mexico is not an elegant solution to the asylum crisis. But the administration is trying to exert control over the border in the absence of action by Congress, and this is one of the tools it has devised. Federal judges might not like it, but it’s not their job to create U.S. border policy, it’s the job of Congress. Maybe Congress should get to it.