Only hours before President Trump’s third travel ban was set to go into effect Tuesday night, it was halted by the same federal court in Hawaii that stopped the second version of the travel ban in March.

In his order, Judge Watson found that President Trump had gone beyond what Congress had allowed him to do, noting that “Professional athletes mirror the federal government in this respect: they operate within a set of rules, and when one among them forsakes those rules in favor of his own, problems ensue. And so it goes with [his third Executive Order].”

The third travel ban would have indefinitely suspended the entry of millions of immigrants from six Muslim-majority countries (as well as North Korea and Venezuela). Wednesday morning, a second judge in Maryland also suspended the ban, ensuring that the majority of Travel Ban 3.0 will not be put into place for now. However, both courts permitted the Trump administration to go forward with its ban on entry for certain Venezuelan government officials and all North Korean immigrants. The government already indicated that it will appeal both decision, teeing up another trip to the Supreme Court later this year.

The court orders blocking the majority of the travel ban come following almost nine months of litigation over President Trump’s ongoing attempts to impose entry restrictions on millions of individuals he has deemed “detrimental” to the United States. The furor over the president’s actions began on January 27, 2017, when he signed an executive order that immediately imposed a 90-day suspension on entry for all individuals from Iran, Iraq, Libya, Somalia, Sudan, Syria, and Yemen.

The initial order, signed on a Friday night with no warning to government agencies ahead of time, caused chaos when it was implemented and was met with mass protests at airports. Within days, a federal court in Seattle blocked the order entirely, a decision which the government unsuccessfully appealed.

After the government lost an initial appeal, President Trump issued a second 90-day travel ban in March. This ban, which President Trump called a “watered-down” version of the first, removed Iraq from the list of affected countries, provided additional reasoning for the ban, and added a waiver process, among other changes. However, this second ban was blocked by two federal courts, one in Hawaii and one in Maryland. Both courts found that the second ban discriminated against Muslims and cited the president’s statements on the campaign trail calling for a “total shutdown” preventing Muslims from entering the United States.

When the government appealed both cases, it lost both times. In the Maryland case, International Refugee Assistance Project (IRAP) v. Trump, the Fourth Circuit Court of Appeals found that President Trump’s campaign statements against Muslims indicated that the travel ban was actually an unconstitutional Muslim ban. Separately, in Hawaii v. Trump, the Ninth Circuit found that President Trump had overstepped the authority Congress gave him to block entry.

The Trump administration appealed both decisions to the Supreme Court, and on June 26, the Supreme Court issued a mixed decision, allowing the 90-day travel ban to go into effect only for individuals who did not have a “bona fide relationship” with a U.S. resident or entity. The Supreme Court also agreed to hear the merits of the case in October. Litigation continued over the next three months about the meaning of the phrase “bona fide relationship,” culminating in the Supreme Court’s upholding a lower court decision that defined the term to include certain extended family members of U.S. residents.

When the second travel ban expired, the Trump administration then issued the third version, which was intended to apply indefinitely. Following the new ban, the Supreme Court cancelled oral arguments on the legality of the second travel ban, and on October 10 vacated the Fourth Circuit’s decision in IRAP v. Trump as moot.

Now that the majority of the new travel ban has been blocked, it is likely that the Supreme Court will once again be asked to intervene. Until then, the third travel ban remains on hold with respect to individuals from Chad, Libya, Iran, Somalia, Syria, and Yemen meaning that most individuals from those six countries should be able to travel to the United States through the normal process.