SAN FRANCISCO (AP) — Another appeals court, another defeat for the Trump administration.

SAN FRANCISCO (AP) — Another appeals court, another defeat for the Trump administration.

The San Francisco-based 9th U.S. Circuit Court of Appeals on Monday refused to reinstate President Donald Trump's executive order banning travelers from six mostly Muslim countries. A three-judge panel said the administration failed to show that blocking citizens from Iran, Libya, Somalia, Sudan, Syria and Yemen was needed to protect the U.S.

The court also found that the president's order ran afoul of an immigration law that prohibits discrimination on the basis of nationality.

Another federal appeals court, the Virginia-based 4th Circuit, last month also refused to reinstate the travel ban, a decision Trump has already appealed to the Supreme Court.

Here's a look at how the rulings compare and what might come next:

How Do The Rulings Differ?

U.S. President Donald Trump leaves after delivering a statement about missile strikes on a Syrian airfield, at his Mar-a-Lago estate in Palm Beach, Florida, U.S., April 6, 2017. Carlos Barria/Reuters

Critics of the ban have asserted that the president's order was motivated by anti-Muslim sentiment, in violation of the Constitution's separation of church and state. The 4th Circuit's ruling took that question head-on, agreeing that the ban officially disfavored Islam — as evidenced by Trump's campaign statements calling for a "total and complete shutdown" on Muslims entering the U.S. — and was thus unconstitutional.

But the 9th Circuit sidestepped that question, saying they didn't need to answer it because the legality of the travel ban could be decided on narrower grounds: It violated immigration law.

While the president has broad authority over immigration, the judges said, to invoke that authority in this case, Trump would have to show the entry of citizens from the six countries would harm the U.S. He made no such showing, they said.

"National security is not a 'talismanic incantation' that, once invoked, can support any and all exercise of executive power," the judges wrote.

By avoiding the question of Trump's motive for banning the travelers, the 9th Circuit avoided a thorny issue about whether courts should consider the president's campaign-trail statements.

The 9th Circuit, however, did not completely ignore the president's statements. The judges pointed to a June 5 tweet by Trump saying the executive order was aimed at "dangerous countries." That helped demonstrate that he was not assessing whether the roughly 180 million citizens of the six countries had ties to terrorism, they said.

What About The Refugees?

Displaced Iraqis who had fled their homes stop for a check by Iraqi forces, as Iraqi forces battle with ISIS militants, in western Mosul, Iraq, March 13, 2017. REUTERS/Suhaib Salem

In addition to banning travelers from six mostly Muslim nations for 90 days, Trump's executive order called for a suspension of the nation's refugee program. In his March ruling striking down the travel ban, a federal judge in Hawaii also held that the suspension of the refugee program was unconstitutional.

The 9th Circuit rebuffed the administration's efforts to reinstate that part of the order as well. The court said the president was required to consult with Congress in setting the number of refugees that would be allowed into the country in a given year and could not decrease that number mid-year.

That issue wasn't before the 4th Circuit, because in the Maryland case it considered, the lower court judge had not struck down the refugee program's suspension.

What Comes Next?

Protesters chant slogans against President Donald Trump's executive order on Muslim immigration, Thursday, Jan. 26, 2017, in downtown Miami. The protesters manifested their opposition to Trump's executive order restricting immigration from some Middle Eastern and African countries. AP Photo/Alan Diaz

Attorney General Jeff Sessions said after Monday's ruling that the ban was necessary to protect national security, and the president was within his lawful authority to enact it.

White House Press Secretary Sean Spicer said the administration was confident that the travel ban would be upheld by the U.S. Supreme Court.

The administration has asked the Supreme Court to immediately reinstate the ban on travelers.

At the Supreme Court, anything is possible if you have five votes — a majority of the court. The justices have a range of options in front of them. They could order an unusual June argument and try to resolve the travel ban lawsuits before they leave town for the summer. They also could essentially do nothing, leaving the two appeals court rulings in place.

One reason the court might feel some responsibility to act — and sooner rather than later — is because the administration has asked for expedited review. The court typically also has the last word when a federal court strikes down a law or presidential order.

A woman with an American flag themed hijab listens to speakers during a protest against President Donald Trump's travel ban, in New York City, U.S. January 29, 2017. REUTERS/Stephanie Keith

The 9th Circuit's more narrow focus on immigration law may appeal to conservative justices on the Supreme Court who might be loath to extend their review beyond the text of the executive order to include the president's campaign statements about a Muslim ban, said David Levine, a professor at the University of California, Hastings College of the Law.

"They don't need to psychoanalyze the president," he said. "They don't need to go beyond the four corners of the order."

___

Johnson reported from Seattle. Associated Press writer Mark Sherman in Washington, D.C., contributed to this report.