WASHINGTON (Reuters) - The U.S. Supreme Court on Friday set up a major showdown over presidential powers, agreeing to decide the legality of President Donald Trump’s latest travel ban targeting people from six Muslim-majority countries.

The conservative-majority court is due to hear arguments in April and issue a ruling by the end of June on whether the ban violates federal immigration law or the U.S. Constitution’s prohibition on religious discrimination. Trump’s policy, announced in September, blocks entry into the United States of most people from Chad, Iran, Libya, Somalia, Syria and Yemen.

The legal fight involves the third version of a contentious policy Trump first sought to implement a week after taking office in January 2017.

The Supreme Court, which is tackling a series of consequential cases during its current term, signaled on Dec. 4 it was likely to uphold the policy. After lower courts had partially blocked it, the Supreme Court on a 7-2 vote let the ban go into full effect while legal challenges by the state of Hawaii and others continued.

The Republican president has said the policy is needed to protect the United States from terrorism by Islamic militants.

“We are confident the Supreme Court will ultimately uphold the president’s lawful and necessary action to keep the American people safe and enforce these important security standards for entry into the United States,” said Raj Shah, a White House spokesman.

Those challenging the policy have argued it was motivated by Trump’s enmity toward Muslims, pressing that point in court with some success by citing statements he made as a candidate and as president.

As a candidate, Trump promised “a total and complete shutdown of Muslims entering the United States.” As president, he has rescinded protections for hundreds of thousands of immigrants who were brought into the country illegally as children, sought to ramp up deportations and pursued new measures restricting legal immigration.

In November, he shared on Twitter anti-Muslim videos posted by a far-right British political figure.

Slideshow ( 3 images )

“We have always known this case would ultimately be decided by the United States Supreme Court. This will be an important day for justice and the rule of law,” said Hawaii Attorney General Douglas Chin, a Democrat.

The American Civil Liberties Union pursued a separate legal challenge in Maryland that is now before the Virginia-based 4th U.S. Circuit Court of Appeals.

“The Supreme Court can and should put a definitive end to President Trump’s attempt to undermine the constitutional guarantee of religious equality and the basic principles of our immigration laws, including their prohibition of national origin discrimination,” ACLU lawyer Omar Jadwat said.

‘THE NATION’S INTEREST’

The case represents a high-profile test of presidential powers. In court papers, U.S. Solicitor General Noel Francisco, arguing for Trump’s administration, said the president has “broad authority to suspend or restrict the entry of aliens outside the United States when he deems it in the nation’s interest.”

Trump signed the latest ban on Sept. 24 after what Francisco called an “extensive, worldwide review” to determine which foreign governments provide information required by the United States to vet those seeking entry.

Hawaii’s lead lawyer Neal Katyal noted that under a federal law called the Immigration and Nationality Act, a president can restrict entry only of people deemed a potential threat or in certain emergency situations. That law also prohibits discrimination on the basis of nationality.

The law does not “surrender to the president a boundless authority to set the rules of entry and override the immigration laws at will,” Katyal said in court papers.

Slideshow ( 3 images )

Trump’s ban also covers people from North Korea and certain government officials from Venezuela, but lower courts had already allowed those provisions to go into effect.

Although lower courts have ruled against Trump over this three travel bans, the Supreme Court has given him a friendlier reception.

In a series of emergency actions, it has issued decisions at least in part favorable to Trump without ever resolving the legal merit of the policies. The justices in June revived parts of Trump's second ban he signed in March. [For a graphic showing a timeline of Trump's travel restrictions, click tmsnrt.rs/2gKl5Ro]

There are some exceptions to the current ban. Certain people from each targeted country can apply for a visa for tourism, business or education purposes, and any applicant can ask for an individual waiver.

Federal district courts in Hawaii and Maryland ruled the current ban unlawful, prompting the administration to appeal. Before the Supreme Court’s December order, lower courts had allowed the ban to go into effect for people with no close relatives in the United States or “formal, documented” relationships with U.S.-based entities such as universities and resettlement agencies.