A large crowd rallies on the steps of the U.S. Supreme Court, led by top Democrat lawmakers, to denounce President Donald Trump’s executive order banning immigration from 7 Muslim-majority countries, on January 30, 2017.

The U.S. Supreme Court on Monday partially allowed President Donald Trump’s executive order suspending immigration from six Muslim-majority nations and the U.S. refugee program to take effect and agreed to hear arguments on the order’s legality in the fall.

The travel ban, which may go into effect within 72 hours, was narrowed by the justices to apply only to foreign nationals who have no “credible claim of a bona fide relationship with a person or entity in the United States.”

In deciding to hear the government’s appeal in the new term, the high court also ordered the parties to address whether the challenges to the travel ban became moot on June 14, the expiration date included in the March 6 executive order.

In limiting the injunctions that blocked the enforcement of the executive order, the court, in an unsigned opinion, said that denying entry to foreign nationals abroad who have no connection to the United States “does not burden any American party by reason of that party’s relationship with the foreign national.”

Justices Clarence Thomas, Samuel Alito Jr. and Neil Gorsuch would have allowed the executive order to take full effect.

The Trump administration, represented by acting Solicitor General Jeffrey Wall, essentially made two requests to the high court. The Justice Department had asked the court to lift injunctions against the executive order imposed by federal judges in Hawaii and Maryland and upheld by the U.S. Courts of Appeals for the Fourth and Ninth circuits. Second, the government wanted the court to grant review to petitions that confront the merits of those circuit court rulings.

Trump first issued the travel ban executive order on Jan. 27. After successful challenges to that order, he withdrew it and issued a revised order on March 6. The new order halted entry into the United States by individuals from the predominantly Muslim nations of Iran, Libya, Somalia, Syria, Sudan and Yemen for at least 90 days. It also suspended entry of all refugees for a period of 120 days.

The Hawaii and Maryland injunctions differed in scope. The Hawaii injunction blocked both parts of the executive order—travel from the six Muslim nations and the refugee program. The Maryland injunction was limited to the Muslim nations’ travel ban.

On June 12, a three-judge Ninth Circuit panel, in an unsigned opinion, held in Hawaii v. Trumpthat the executive order exceeded Trump’s authority under federal immigration law and violated that law’s ban on discrimination on the basis of nationality. It also narrowed the injunction to allow the government to review vetting procedures for the admission of immigrants.

Just weeks earlier, the full Fourth Circuit, in a 10-3 decision in International Refugee Assistance Project v. Trump, ruled the order was religious discrimination in violation of the Constitution’s establishment clause.

The executive order, the majority said, “in text speaks with vague words of national security, but in context drips with religious intolerance, animus, and discrimination.”

In the government’s petitions for review of the circuit court rulings, Wall challenged the standing to sue of those individuals bringing the two court cases. He also argued that the order does not violate the Constitution’s establishment clause or federal immigration law and was entitled to deference under the Supreme Court’s 1972 decision in Kleindienst v. Mandel.

Mandel, Wall said, instructed courts to look no further than whether there is a “facially legitimate and bona fide reason” for the temporary suspension on entry. The president’s national security determination, he added, provides just such a reason. In asking the justices to grant review to both petitions, Wall urged the court to hold arguments in the new term.

In response, Hogan Lovells partner Neal Katyal, representing the Hawaii challengers, and the ACLU’s Omar Jadwat, counsel to the Maryland challengers, argued the high court should not lift the injunctions or grant review to the government’s petitions. They noted that Trump on June 14 issued a memorandum instructing federal agencies to begin the 90-day and 120-day vetting reviews within days, but to put the order’s bans into effect whenever the injunctions were lifted.

“This memorandum conclusively severs the already tenuous relationship between the bans and their ostensible rationale by making clear that the order’s travel and refugee restrictions may begin even after the vetting reviews are completed,” Katyal wrote. He noted that Trump himself in a tweet had claimed the government already was engaged in “extreme vetting” that the executive order was supposed to facilitate.

Katyal and Jadwat also disputed the government’s reliance on Mandel, describing the government’s argument as a “breathtaking vision of unreviewable executive power.”