The travel ban - which was put on hold by lower court rulings - will apply to those "who lack any bona fide relationship with a person or entity in the United States", until the court hears the case in October, the justices ruled. Those groups said they will be sending lawyers and monitors back to American airports, where the initial, immediate implementation of the ban in January caused chaos and confusion.
The White House said the ban would come into force within 72 hours of the ruling. That means it will take effect Thursday morning.
His March 6 order called for a blanket 90-day ban on people from Libya, Iran, Somalia, Sudan, Syria and Yemen and a 120-day ban on all refugees to enable the government to implement stronger vetting procedures. Refugees "in transit" and already approved would have been able to travel to the United States under the executive order.
The first executive order was issued one week into his term, and sought to bar people from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen from entering the USA for 90 days and all refugees for 120 days. That review should be complete before October 2, the first day the justices could hear arguments in their new term. Justice Anthony Kennedy wrote in a 2015 immigration case that a "legitimate and bona fide" reason for denying entry to the United States can pass muster.
In a statement, Trump called the high court's action "a clear victory for our national security", saying the justices allowed the travel suspension to become largely effective.
Three of the court's conservative justices said they would have let the complete bans take effect.
Justice Clarence Thomas, with Justices Samuel Alito and Neil Gorsuch concurring, argued the injunctions should have been stayed in full.
As for refugees, the court held that a person seeking refuge in the U.S. can claim "concrete hardship" - but in the end, if they "lack any such connection to the United States. the balance tips in favor of the government's compelling need to provide for the Nation's security".
Trump hailed the court's order as a "clear victory for our national security", especially after lower court rulings that blocked the travel ban in its entirety.More news: Ahman Green jailed on suspicion of child abuse
He added: "My number one responsibility as Commander in Chief is to keep the American people safe". The plans were described by a senior official who was familiar with them, speaking on condition of anonymity because this person was not authorized to discuss them publicly by name. Challengers to the ban said it would harm people who have legitimate reasons to be in the USA - including through family ties, work and education.
That was immediately contested by immigrant rights and civil liberties groups challenging the travel ban, who argued that most would-be travelers can not be barred under the court's compromise ruling.
Even before the Supreme Court action the ban applied only to new visa applicants, not people who already have visas or are US permanent residents, known as green card holders.
Examples of formal relationships include students accepted to USA universities and an employee who has accepted a job with a company in the USA, the court said.
Those who would qualify for travel to the United States would include: + Students who have been admitted to a university + A foreign national who wants to visit a family member + Someone who has accepted a job in the U.S. + An academic who has been invited to give a lecture. Two federal appeals courts left those nationwide injunctions in place, setting up one final appeal for the Trump administration.
Donald Trump had raised the issue of travel ban during his presidential campaign.
The 4th U.S. Circuit Court of Appeals looked extensively at whether the travel ban violated the Constitution by discriminating on the basis of religion.
The revised travel ban, issued in March, blocks most new immigrants from six predominantly Muslim countries for 90 days and all refugees for 120 days.