The Trump administration has finally secured a victory on its “travel ban” — which will bar some citizens of six majority-Muslim countries from entering the US for a period of 90 days, and an untold number of refugees from entering the country for 120 days.

The Supreme Court ruled Monday that despite appellate courts in two different federal courts blocking the ban while judges decide whether it’s constitutional, the Trump administration should be allowed to enforce the ban starting on Thursday, June 29 (72 hours after the court’s ruling was issued). The Supreme Court will take up the question of constitutionality this fall.

The Trump administration will begin to bar some citizens of Iran, Libya, Somalia, Sudan, Syria, and Yemen from entering the US for 90 days later this week. And it will be able to stop some refugees from entering for 120 days.

But anyone who already has a valid visa should still be allowed to enter the country. And because of limitations placed on the administration by the Court’s ruling, the administration isn’t supposed to deny visas to anyone who has a “bona fide relationship” with a person or organization inside the United States.

The Supreme Court offered some guidance about who will be allowed to enter under its modified ban. But there are still big questions about how the administration will implement it — especially when it comes to refugees.

The Court will hear the lawsuits against the ban in the fall. But the legal fight has suddenly turned anticlimactic. For the first time since February, the Trump administration’s signature immigration policy is going to shape people’s lives.

The Trump administration’s first court win came not a moment too soon

When Donald Trump was inaugurated, his promise to bar people from countries compromised by terrorism from entering the US was one of his signature policy initiatives. Before the Supreme Court’s ruling on Monday, it was in danger of becoming a punchline — the most embarrassing and high-profile setback in an administration that’s had plenty.

On January 27, President Trump signed an executive order that prevented anyone from Iraq, Iran, Libya, Somalia, Sudan, Syria, or Yemen from entering the US for the next 90 days, while the federal government undertook a review of the visa-granting process to figure out which countries didn’t provide enough information about people seeking to come to the US. Additionally, he barred refugees from coming to the US for 120 days — unless they were “persecuted religious minorities”; barred Syrian refugees indefinitely; and slashed the total number of refugees the US would accept in a year, even after the initial ban had passed.

The order didn’t explicitly single out Muslim immigrants. But to many, the connection was clear enough on its own. After all, before candidate Trump promised to bar immigration based on country, he’d called for a “total and complete shutdown of Muslims entering the United States.”

The order was signed on a Friday night — with key officials in the government not knowing what it said until afterward (and even disagreeing with each other about who, exactly, was banned). By midnight, it had gone into effect. And chaos reigned.

Customs and Border Protection officials weren’t trained on what, exactly, they were supposed to do to implement the ban. Dozens of people were held in airports after arriving in the US, interrogated, and often sent back. Pro bono lawyers and protesters amassed at major airports. And 50,000 permanent residents of the United States were told they would be prevented from leaving and reentering the country — and then, ultimately, told they weren’t covered in the ban.

Then, after a little less than a week, the whole thing was put on hold.

A group of states sued the administration over the ban, which they argued was unconstitutional; on February 3, a federal judge agreed that the administration had to stop enforcing the ban until the court case had been resolved. The Ninth Circuit Court of Appeals also sided against the administration.

The administration, seeing the writing on the wall, decided to go back and try again. Trying to build a case that the ban was needed for national security purposes, it asked several government agencies for feedback (though many of the agencies replied that a country-based ban made no sense). It narrowed the scope of the ban to respond to the courts’ objections. And on March 6, it issued a new version of the executive order to go into effect on March 16.

It never got there. On the eve of the “travel ban 2.0” going into effect, federal judges in Maryland (in a lawsuit filed by a coalition of advocacy groups) and Hawaii (in a lawsuit led by Hawaii and other states) did the same thing the Washington judge had done to the first travel ban: They put it on hold while they considered its constitutionality more fully. Appellate courts in the East Coast Fourth Circuit and the West Coast Ninth Circuit agreed.

By the time the Trump administration appealed the case to the Supreme Court — mere weeks before the highest court took its summer recess — it hadn’t had a single victory in two rounds of litigation.

Furthermore, it was in danger of losing the ability to institute a temporary ban at all. In early June, the Ninth Circuit ruled that the Trump administration would be allowed to start the review of visa procedures that the 90-day ban was supposed to make easier — it just wouldn’t be able to put the 90-day ban itself in place. The administration, therefore, was facing the possibility that by the time the Supreme Court took up the case, it would already have had 90 days to review visa procedures — and would have a much harder time arguing a ban was needed to begin with.

But the Supreme Court gave the administration the win it needed, right when it needed it.

People without a “bona fide relationship” to the US can be banned starting Thursday

The Supreme Court’s ruling, issued Monday on the last day of the term before its summer recess, was unsigned. Six justices — the Court’s four liberal justices (Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor, and Elena Kagan) joined Justice Anthony Kennedy and Chief Justice John Roberts in partially lifting the hold on the ban. Conservative Justices Neil Gorsuch, Clarence Thomas, and Samuel Alito argued that the Trump administration should be allowed to enforce the ban in all cases.

The Court’s ruling is technically a “partial stay” of the lower courts’ injunction. In plain English, the Supreme Court has stopped the hold on the travel ban in certain cases, allowing the administration to ban some of the people it wanted to ban from the US.

Due to the Court’s ruling, the Trump administration will be able to bar citizens of Iran, Libya, Somalia, Sudan, Syria, and Yemen from entering the United States for a period of 90 days, and bar nearly all refugees from entering the US for a period of 120 days — but only if they haven’t already been issued a valid visa, and only if they don’t have a “bona fide relationship with a person or entity in the United States.”

The question this raises, of course, is what counts as a “bona fide” relationship. And while the Supreme Court sort of answers that question, it leaves some big gaps — especially when it comes to refugees.

As Vox’s Tara Golshan reported Monday, many groups that assist refugees are trying to figure out for themselves what this ruling means.

“With this administration, you can’t take anything off the table because of just how inconsistent the implementation has been,” Justin Cox, staff attorney with the National Immigration Law Center, told Golshan.

The Court’s ruling Monday specifies that people “coming to live with or visit a family member” should be allowed into the US, even if they come from one of the six blacklisted countries (or are a refugee) and even if they didn’t already have a valid visa when the ban goes into effect on June 29. So will people coming to study, teach, or speak at American schools or work for American businesses.

That covers a whole lot of people who come to the US on visas. In fact, the only people likely to be barred from entering the US because they come from one of the six blacklisted countries are tourists who aren’t coming to visit family in the US.

The Supreme Court’s ruling won’t block many visa applicants. It’s much muddier — and perhaps much broader — on blocking refugees.

But when it comes to the other ban — the 120-day ban on refugees — the Court’s decision is much muddier, and possibly much, much broader.

Refugees don’t already have jobs before they’re allowed to settle in the US, and many of them don’t already have close family here. Few refugees are likely to fall into one of the specific “bona fide relationships” that the Supreme Court opinion explicitly calls out.

But all refugees do have a relationship with a US-based organization. US-based “refugee resettlement agencies” are responsible for settling refugees in the United States, and every refugee entering the US has already been placed with an agency.

The problem is that the Supreme Court didn’t clarify whether being a client of a refugee resettlement agency counts as a “bona fide relationship” — indeed, the fact that it specified that refugees should only be allowed into the US if they have a “bona fide relationship” implies that they think at least some refugees don’t meet that standard (which would mean a resettlement agency doesn’t count). But it didn’t explicitly say resettlement agencies don’t count, either.

Many of the organizations that have fought the travel ban so far believe that the Supreme Court’s ruling shouldn’t bar any refugee who’s already been placed with a resettlement agency. But that doesn’t mean the Trump administration will agree. If the Trump administration starts denying visas to refugees who’ve already been accepted for resettlement, it will likely face a whole new round of lawsuits — and the legal fight over the travel ban will continue over the summer. But this time, the Trump administration will be coming from a position of strength.

Don’t expect airport chaos. Do expect a lot more lawsuits.

The Supreme Court’s ruling lifted the hold on the executive order effective immediately. But thanks to a memo issued last week by the Trump administration, the government has 72 hours to put the modified ban into effect.

That’s more time than the government got to figure out how to enforce the first version of the travel ban, in January. But it’s less time than it gave itself in March, before the courts stopped the second version of the ban on the eve of its implementation.

For an administration that isn’t known for its smooth management style or its flawless coordination of complicated government initiatives, that might not be enough time to make sure the ban is being implemented exactly as the Supreme Court has now allowed it.

Under the terms of the March executive order, the ban is only supposed to apply to people who haven’t already been issued valid visas to come to the US. Since people can only fly to the US if they have valid visas, this should mean that no one is detained at a US airport under the terms of the ban after Thursday.

It’s possible that (just like the first time) Customs and Border Protection agents at airports won’t be given any training about how to implement the ban — and it’s possible that when left to their own devices, they might get overly aggressive about enforcing it.

But because of the differences between the original travel ban and this one, it’s likely that enforcement of the travel ban won’t be taking place at airports or anywhere else outraged lawyers and progressives can amass. It’s probably going to happen outside the US, at consulates abroad, where officials will refuse to grant a visa to citizen from affected countries because they don’t think he has a “bona fide” enough relationship to something in the US. And it’s going to happen at refugee camps and other processing facilities, where people in the midst of the two-year process to be allowed to come to the US as a refugee will find that two years extended by another four months (or longer, depending on what new procedures are put into place after the 120 days are up).

Unless the Trump administration is extremely cautious, and only denies visas to people in very limited cases, it’s likely to face court battles over the definition of a “bona fide” relationship. (Indeed, this was part of the reason the conservative justices argued the ban needed to go into effect in full; they thought the Supreme Court ruling was just going to open a flood of new lawsuits.) But now that the Supreme Court itself has ruled, these lawsuits aren’t going to result in broad rulings against the ban as a whole. They’ll just be tinkering around the edges, figuring out whether one person, or one group of people in similar circumstances, has “bona fide” reasons to enter the US.

By the time the Supreme Court actually hears the case, the case may be moot

The Court has agreed to hear the case against the travel ban when it comes back in session in October. By that point, the 90-day ban will likely have been completed, and the 120-day refugee ban may be nearing its end as well.

Indeed, by the time the Court takes up the case, the temporary ban may well have been replaced with an indefinite one.

Now that the Trump administration has been allowed to put its 90-day travel ban into effect, it — in theory — should be able to complete a full review of visa procedures (which was the reason it claimed it needed to institute the ban to begin with). It then should have a list of countries that don’t provide enough information to the US to be able to screen their citizens. Those countries, per the executive order, will then be given notice that they need to start providing more info to the US — and if they don’t shape up, they’ll be put on an indefinite visa blacklist until they do.

It’s totally unclear whether the indefinite blacklist will be narrower, or broader, than the list of six countries. And, importantly, the challenges to the travel ban so far haven’t really touched on whether the indefinite blacklist is unconstitutional. So it’s entirely possible that by the time the Supreme Court hears oral arguments about the constitutionality of Trump’s executive order, the most controversial parts of the executive order will already have come and gone.

The Trump administration has its ban. As policy, it’s not quite as sweeping as it initially wanted; depending on how the refugee question gets settled, the administration might have half a ban or might have not much of a ban at all. But it’s been spared the embarrassment of having tried to rewrite an executive order to pass court muster, only to have it completely dismissed by the courts. Instead, it’s the challengers of the travel ban who are now facing what might be an empty victory: No one’s said the travel ban is certainly constitutional, but it’s going to happen anyway.