(Reuters) - Federal appeals courts in the states of Washington and Virginia are set to hear arguments this week on the legality of President Donald Trump’s most recent travel ban, which sharply limits visitors and immigrants from eight countries, six of them Muslim-majority.

Slideshow ( 3 images )

Challengers, including the state of Hawaii and immigrant advocacy organizations and the American Civil Liberties Union (ACLU), argue the ban is discriminatory and violates the U.S. Constitution. The Trump administration says it is necessary to protect the United States from terrorist attacks.

The 9th U.S. Circuit Court of Appeals, which is based in San Francisco, will hold a hearing in Seattle, Washington on Dec. 6 and the Richmond, Virginia-based 4th U.S. Circuit Court of Appeals has its hearing on Dec. 8.

Soon after taking office in January, Trump signed an order temporarily barring all refugees and visitors from seven predominately Muslim countries. The decision led to chaos at airports and numerous legal challenges and the administration eventually replaced it with a second, somewhat narrower order.

When the second ban expired in September, Trump replaced it with a presidential proclamation indefinitely restricting travel from Iran, Libya, Syria, Yemen, Somalia, Chad, North Korea and barring certain government officials from Venezuela.

The administration said the restrictions were put in place after a worldwide review of each country’s ability to issue reliable passports and share data with the United States.

After the most recent order was issued, the same challengers who sued to stop the earlier bans went back to court. They said the new version still discriminated against Muslims in violation of the U.S. Constitution. The lawsuits did not dispute the restrictions placed on Venezuela and North Korea.

All refugees were temporarily barred as part of Trump’s first order but were not addressed in the latest ban. Instead, under a separate directive issued Oct. 24, refugees from 11 countries mostly in the Middle East and Africa now face additional security screening.

The 9th circuit appeals court on Nov. 13 ruled the ban could go partially into effect for everyone without close family relationships to people in the United States. The White House has asked the U.S. Supreme Court to lift those partial restrictions while the cases are moving forward in lower courts so that the ban would apply to everyone.

The government argues the president has broad authority to decide who can come into the United States, but detractors say the expanded ban violates a law forbidding the government from discriminating based on nationality when issuing immigrant visas.

The administration has repeatedly said the ban is not discriminatory and pointed out that many Muslim-majority countries are unaffected by it. Trump has made statements, however, that his legal opponents say reinforce their contention that his actions are based in anti-Muslim sentiments.

Last week, for example, the president shared on Twitter anti-Muslim videos posted by a far-right British party leader.

In response to the tweet, Neal Katyal, attorney for the State of Hawaii Tweeted: “Thanks! See you in court next week.” The ACLU said in a letter sent to the Supreme Court on Monday that the group planned to file a motion that would expand the record to include the recent statements by the President.