Trump said the ban will come in effect within 72 hours of the court's decision.
The Supreme Court said lower courts' injunctions preventing the entire ban from taking effect had gone too far because denying entry to "foreign nationals overseas who have no connection to the United States at all. does not burden any American party by reason of that party's relationship with the foreign national". One court ruled that the executive order discriminated on the basis of religion - Trump had called for a Muslim ban during the campaign, and the court concluded that the travel ban implicitly incorporated that view.
That's no minor exception, according to immigrant groups, who say relatively few people come to the USA from the affected countries without such close ties.
The court said the distinction should be easy to administer.
Trump issued the order amid rising global concern about attacks carried out by Islamist militants like those in Paris, London, Brussels, Berlin and other cities. But they said they are anxious about other immigrants, including refugees who may be desperate for help but lack USA relations.
A 120-day ban on refugees is also being allowed to take effect. The opinion faulted the two federal appeals courts that had blocked the travel policy for going too far to limit Trump's authority over immigration.
The White House has argued that immigration law gives the president sweeping power to block entry to the United States, but challengers charge it violates the US Constitution's ban on religious discrimination and is overly broad.
"With many groups, it's clear-cut from the type of visa: Anyone coming in on family visa or employment visa, by their terms it's clear they have a bona fide relationship", he said.
The Supreme Court's decision to partially reinstate President Donald Trump's temporary travel ban leaves the effort to keep some foreigners out of the country in a murky middle ground riddled with lingering questions and possibly more cumbersome litigation.
However, until it can issue a definitive ruling, the high court authorized the Trump administration to deny U.S. entry to people affected by the ban who do not have relatives in the U.S. or who have no previously established plans to work at companies or study at educational institutions in the US.
The justices are expected to hear the travel order case in the fall, but they noted that they will also consider whether the case is moot at the that point.
"It is crucial that we properly vet those seeking to come to America from these locations, and failing to do so puts us all in danger". "Particularly some of the countries on the travel ban list are places where paperwork is not regularly held".
While the ban did not single out Muslims, lower court judges cited Trump's repeated campaign statements that he meant to ban Muslims from entering the United States. But that vetting is done with the assistance of the foreign countries the applicants are traveling from. It had no students from the three other nations targeted by the travel ban: Somalia, Sudan and Yemen.