UPDATE: (AP) - The Supreme Court is letting a limited version of the Trump administration ban on travel from six mostly Muslim countries to take effect, a victory for President Donald Trump in the biggest legal controversy of his young presidency.

The court said Monday the ban on visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen could be enforced as long as they lack a “credible claim of a bona fide relationship with a person or entity in the United States.” The justices will hear arguments in the case in October.

Trump said last week that the ban would take effect 72 hours after being cleared by courts.

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

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

Three of the court’s conservative justices said they would have let the complete bans take effect.

Justice Clarence Thomas, joined by Justices Samuel Alito and Neil Gorsuch, said the government has shown it is likely to succeed on the merits of the case, and that it will suffer irreparable harm with any interference. Thomas said the government’s interest in preserving national security outweighs any hardship to people denied entry into the country.

Two federal appeals courts had blocked the travel policy, which Trump announced a week after he took office in January and revised in March after setbacks in court.

The 4th U.S. Circuit Court of Appeals in Richmond, Virginia, said the ban was “rooted in religious animus” toward Muslims and pointed to Trump’s campaign promise to impose a ban on Muslims entering the country as well as tweets and remarks he has made since becoming president.

The San Francisco-based 9th U.S. Circuit Court of Appeals said the travel policy does not comply with federal immigration law, including a prohibition on nationality-based discrimination. That court also put a hold on separate aspects of the policy that would keep all refugees out of the United States for 120 days and cut by more than half, from 110,000 to 50,000, the cap on refugees in the current government spending year that ends September 30.

Trump’s first executive order on travel applied to travelers from the six countries as well as Iraq, and took effect immediately, causing chaos and panic at airports over the last weekend in January as the Homeland Security Department scrambled to figure out who the order covered and how it was to be implemented.

A federal judge blocked it eight days later, an order that was upheld by a 9th circuit panel. Rather than pursue an appeal, the administration said it would revise the policy.

In March, Trump issued the narrower order.

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

PREVIOUS STORY: (NBC News) — The U.S. Supreme Court heads into Monday, its last day of the current term, with two important questions so far unanswered: What's to become of President Donald Trump's travel ban and will 80-year-old Justice Anthony Kennedy retire?

The court will also announce the remaining decisions of the term, including the fate of laws in 39 states that bar direct taxpayer aid to churches and the ability of the parents of a 15-year-old boy to sue the federal border agent who killed him.

The Justice Department has urged the justices to lift bans imposed by lower courts blocking enforcement of the president's executive order on travel. It called for a 90-day ban on issuing visas to citizens of Iran, Sudan, Syria, Libya, Somalia and Yemen who want to come to the US.

The administration argued that the measure had a legitimate national security purpose, allowing the government to assess the reliability of background information on visa applicants from six countries associated with terrorism.

The Fourth Circuit Court of Appeals, based in Richmond, Virginia, said the executive order amounted to unconstitutional religious discrimination. Its ruling cited campaign statements by Trump, who originally called for a ban on Muslim immigration.

Separately, a panel of three judges from the Ninth Circuit Court of Appeals said the order violated federal immigration laws that require a more substantial national security justification than the White House offered.

The Supreme Court is expected to announce whether it will take up the appeal of those lower court orders and, in the meantime, allow the government to enforce the executive order while the appeal is pending.

Speculation about a possible retirement by Kennedy also has been swirling for months, partly fueled by rumors. Sen. Charles Grassley, the Judiciary Committee chairman, said in April that he "would expect a resignation this summer," but added that he had no definitive information.

Kennedy will turn 81 in another month. A Ronald Reagan appointee, he has served on the Supreme Court for 29 years. Some friends say he has suggested that he might retire. But he has given no outward sign that he might, and he has hired his normal complement of law clerks for the coming term.

A Kennedy retirement would give Trump the ability to profoundly reshape the court. In many divisive cases, the court lineup tends to be four conservatives and four liberals, with Kennedy casting the fifth and deciding vote.

With Kennedy joining the conservatives, the court gutted the Voting Rights Act, reduced federal regulation of money in political campaigns, and declared that the Second Amendment provides an individual right to gun ownership.

Kennedy's votes with the liberals produced rulings striking down state laws against same-sex marriage, upholding abortion rights, and limiting the use of the death penalty.

"A Kennedy retirement would be an epic change," said Tom Goldstein, a Washington, D.C., lawyer and publisher of SCOTUSblog. "Kennedy is a conservative but has moderate tendencies. A replacement chosen by President Trump would give conservatives the solid majority on the court they've been hoping for since the Nixon administration."

Justices Ruth Bader Ginsburg, who is 84, and Stephen Breyer, 78, have shown no signs that they intend to step down.

Also Monday, the court will likely announce whether it will take or reject several appeals that have been piling up for months, including the right to carry a gun outside the home and whether businesses can refuse to provide their services for same-sex marriage ceremonies.