WASHINGTON - The Supreme Court has agreed to decide the legality of the latest version of President Donald Trump's ban on travel to the United States by residents of six majority-Muslim countries. The issue pits an administration that considers the restrictions necessary for Americans' security against challengers who claim it is illegally aimed at Muslims and stems from Trump's campaign call for a "complete shutdown of Muslims" entering the U.S.

The justices plan to hear argument in April and issue a final ruling by late June on a Trump policy that has been repeatedly blocked and struck down in the lower courts.

The latest of those rulings came last month when the federal appeals court in San Francisco ruled that the travel ban Mr. Trump announced in September violates federal immigration law.

Get Breaking News Delivered to Your Inbox

The federal appeals court in Richmond, Virginia, also is considering a challenge to the ban.

Last month, the high court said the ban could be fully enforced while appeals made their way through the courts.

The policy applies to travelers from Chad, Iran, Libya, Somalia, Syria and Yemen. It also affects two non-Muslim countries: blocking travelers from North Korea and some Venezuelan government officials and their families.

The Supreme Court has never ruled on whether any of the three versions of the travel ban is legal. The court agreed last June to take up the second version until it expired in the early fall.

Mr. Trump's first travel ban was issued almost a year ago, almost immediately after he took office. It banned travel from seven countries: Yemen, Syria, Afghanistan, Libya, Somalia, Iraq and Iran. The Trump administration had said that the intent of the ban is to improve screening and prevent terrorists from entering the country, and to evaluate how well countries are complying with U.S. vetting procedures.

The original ban triggered chaos and protests across the U.S. as travelers were stopped from boarding international flights and detained at airports for hours. Mr. Trump tweaked the order after the U.S. Court of Appeals for the 9th Circuit refused to reinstate the ban.

The next version, unveiled in March, dropped Iraq from the list of covered countries and made it clear the 90-day ban covering Iran, Libya, Somalia, Sudan, Syria and Yemen didn't apply to those travelers who already had valid visas. It also got rid of language that would give priority to religious minorities. Critics said the changes didn't erase the legal problems with the ban.

The same appeals courts that are evaluating the current policy agreed with the challengers. The 4th U.S. Circuit Court of Appeals in Richmond said the ban "drips with religious intolerance, animus and discrimination." The San Francisco-based 9th U.S. Circuit Court of Appeals ruled that Trump violated immigration law.

The Supreme Court allowed the ban to take partial effect, but said those with a claim of a "bona fide" relationship with someone in the United States could not be kept out of the country. Grandparents, cousins and other relatives were among those who could not be excluded. But the high court said lower courts were wrong to apply the same limits to the new policy, at least while it is being appealed. The justices did not explain their brief order.

The third version is permanent, unlike the other two, and the administration said it is the product of a thorough review by several agencies of how other countries' screen their own citizens and share information with the U.S.

Solicitor General Noel Francisco said in court papers that the policy is well within the president's "broad authority to suspend or restrict the entry of aliens outside the United States when he deems it in the Nation's interest."

In response, the challengers said the policy violates the Constitution because it is biased against Muslims and also violates immigration law. The new version continues "the same unlawful policy" that was struck down by lower courts last year, lawyer Neal Katyal said in his brief on behalf of the challengers.