A Virginia-based federal appeals court pulled no punches in refusing to reinstate President Donald Trump’s revised travel ban, with judges in the 10-3 majority calling the administration’s action discriminatory and its reasoning nonsensical.

The 4th U.S. Circuit Court of Appeals opinion Thursday upheld a Maryland judge’s decision to block the travel ban from taking effect. It was the first appeals court to weigh in on the travel ban.

A three-judge panel of the San Francisco-based 9th Circuit is expected to rule soon after hearing arguments in Seattle this month, and the issue is likely to reach the Supreme Court.

Here’s a look at what the 4th Circuit decided and what might come next.

———

ARE TRUMP’S CAMPAIGN STATEMENTS RELEVANT?

According to at least eight of the judges in the majority, yes. Chief Judge Roger Gregory wrote that it was appropriate to consider Trump’s comments calling for a Muslim ban.

But Gregory stressed there should be no bright-line rule governing when it’s appropriate to consider an officeholder’s campaign statements.

“A person’s particular religious beliefs, her college essay on religious freedom, a speech she gave on the Free Exercise Clause — rarely, if ever, will such evidence reveal anything about that person’s actions once in office,” he wrote. “For a past statement to be relevant to the government’s purpose, there must be a substantial, specific connection between it and the challenged government action.”

The groups challenging the ban made a compelling case that the primary purpose of Trump’s revised travel ban was to discriminate against Muslims, in violation of the Constitution’s ban on the government favoring or disfavoring any religion, the majority said.

One judge, Stephanie Thacker, an appointee of President Barack Obama, said in a concurring opinion she would not consider statements by candidate Trump — but, she added, it wasn’t necessary to. She cited Trump adviser Rudy Giuliani’s comments following Trump’s inauguration that the president had asked him to figure out how to legally implement a Muslim ban.

The three dissenting judges, Republican appointees Paul Niemeyer, Dennis Shedd and G. Steven Agee, accused the majority of “fabricating a new proposition of law.” Campaign statements — often ambiguous, retracted, clarified and politically charged — might provide fertile ground for anyone who wanted to recast the intent of an official’s action in an effort to show discrimination, they said.

———

NATIONAL SECURITY

Acting Solicitor General Jeffrey Wall argued that the president’s directive falls squarely within his duty to secure the nation’s borders and that it does not discriminate against Muslims in its language or in its operation.

The majority didn’t buy it.

The only examples Trump’s order cited of immigrants born abroad and convicted of terrorism-related crimes in the United States include two Iraqis and a Somalian refugee, Gregory wrote. Iraq is not among the six predominantly Muslim countries included in the travel ban, and the Somalian came to the U.S. as a child and was radicalized here as an adult.

The travel ban “appears to be a post hoc, secondary justification for an executive action rooted in religious animus and intended to bar Muslims from this country,” he wrote.

In her concurrence, Thacker called the government’s reasoning untenable. She noted that two non-Muslim nations, the Philippines and Venezuela, weren’t included among the banned countries even though they are home to terrorist groups and fail to help verify information about people attempting to travel to the United States.

“The Government has not consistently applied the criteria it claims it used, and the reason seems obvious — and inappropriate,” she wrote.

———

SUPREME COURT

Attorney General Jeff Sessions swiftly said the Justice Department will ask the Supreme Court to review the 4th Circuit’s decision. Sessions says the Justice Department “strongly disagrees” and will continue to vigorously defend Trump’s order. He says the court’s ruling blocks Trump’s “efforts to strengthen this country’s national security.”

The Supreme Court almost always has the final say when a lower court strikes down a federal law or presidential action.

Trump could try to persuade the Supreme Court to allow the policy to take effect, even while the justices weigh whether to hear the case, by arguing that the court orders blocking the ban make the country less safe.

A vote on whether to grant that request could signal the court’s ultimate decision.

It takes a majority of the court, five votes, to put a lower court ruling on hold. One factor in that first vote is whether the government is likely to win in the end. If at least five justices vote to let the travel ban take effect, there’s a good chance they also would uphold the policy later on.

Conversely, it’s hard to imagine that a majority would uphold the travel ban if there are not five votes to let it take effect pending a final ruling.