WASHINGTON (AP) - The Supreme Court is allowing President Donald Trump to forge ahead with a limited version of his ban on travel from six mostly Muslim countries to the U.S. Trump hailed the decision as a "victory for national security," but it's likely to set off a new round of court disputes over anti-terror efforts and religious discrimination.

The justices will hear full arguments in October in the case that has stirred heated emotions across the nation and pointed rebukes from lower courts saying the administration is targeting Muslims. Until then, the court said Monday, Trump's ban on visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen can be enforced if those visitors lack a "credible claim of a bona fide relationship with a person or entity in the United States."

The ruling sets up a potential clash between the government and opponents of the ban over the strength of visitors' ties to the United States. A senior official said plans already had been written to enforce the ban aggressively. But immigrant groups said relatively few people try to enter the United States without well-established ties. 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.

State Department spokeswoman Heather Nauert said the ban would be implemented starting 72 hours after being cleared by courts. That means it will take effect Thursday morning.

The president has denied that the ban targets Muslims but says it is needed "to protect the nation from terrorist activities" committed by citizens of the six countries. All six have been designated as presenting heightened concerns about terrorism and travel to the United States.

The 90-day ban is necessary to allow an internal review of screening procedures for visa applicants from the countries, the administration says. That review should be complete before Oct. 2, the first day the justices could hear arguments in their new term.

The ban will have run its course by then, raising a question of whether the justices will even issue a decision in the case or dismiss it because it has been overtaken by events.

The court asked both sides to address the issue of timing, along with questions about whether the ban is aimed at Muslims, the impact of Trump's provocative campaign statements and federal courts' authority to restrain the president in the area of immigration.

A 120-day ban on refugees also is being allowed to take effect on a similar, limited basis.

Three of the court's conservative justices said they would have let the administration apply the bans without the limits imposed by their colleagues.

Justice Clarence Thomas, joined by Samuel Alito and Neil Gorsuch, said the government has shown it is likely to win the legal case in the end. Thomas said the government's interest in preserving national security outweighs any hardship to people denied entry into the country.

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. He said in a statement that his "number one responsibility" is to keep Americans safe.

His administration's implementation plans, largely orchestrated by White House adviser Stephen Miller, focus on refusing entry to people who are unable to show a substantial and pre-existing tie to a person or institution in the United States. 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.

But some immigration lawyers said relatively few people would fall under the ban because people coming to study, work or visit family members already have sufficient relationships with others already is in the country.

"This order, properly construed, should really allow for only the narrowest implementation of any part of the ban. It's going to be really important for us to make sure the government abides by the terms of the order and does not try to use it as a back door into implementing the full- scale Muslim ban," said Omar Jadwat, the American Civil Liberties Union lawyer who is representing some of the challengers to the travel ban.