(CNN) -- A federal appeals court upheld Thursday a ruling blocking President Donald Trump's travel ban against six Muslim-majority countries.
The 10-3 ruling from the 4th US Circuit Court of Appeals upholds a lower court's decision to halt core portions of the executive order indefinitely.
The ban was announced in March, but never got off the ground because federal courts blocked it just hours before it was set to go into effect. It would have banned people from Iran, Libya, Somalia, Sudan, Syria, and Yemen from entering the US for 90 days and all refugees for 120 days.
The court makes extensive use of Trump's comments during his campaign when he called for a full ban on Muslims from entering the United States as evidence against this executive order.
"The evidence in the record, viewed from the standpoint of the reasonable observer, creates a compelling case that (the executive order's) primary purpose is religious," the ruling states. "Then-candidate Trump's campaign statements reveal that on numerous occasions, he expressed anti-Muslim sentiment, as well as his intent, if elected, to ban Muslims from the United States."
CNN legal analyst and and professor at the University of Texas School of Law Steve Vladeck called the ruling "an enormous victory for the challengers to the travel ban, and a huge loss" for Trump.
This was the Trump administration's second attempt to install a travel ban. The first version, announced in January, also included Iraq.
"In its first test before a federal appeals court, the second, more nuanced version of the Executive Order still failed miserably -- and, once again, largely because of President Trump's own words, tweets, and statements," Vladeck said. "About the only thing the 10 judges in the majority disagreed about was whether President Trump's campaign statements are relevant to his motive -- but even the judges who said no still thought there was enough evidence of discriminatory intent since his inauguration to strike down the ban."
Then-candidate Trump issued a statement calling for the "total and complete shutdown" of Muslims entering the United States until the government could "figure out what is going on," in response to a deadly mass shooting in San Bernardino, California by ISIS sympathizers in December 2015.
Trump later read the plan at South Carolina rally, saying: "We have no choice. We have no choice."
The Muslim ban language was removed one day after oral arguments in the 4th Circuit case.
Next stop Supreme Court?
Thursday's ruling is the latest step on a likely trip to the Supreme Court. The 9th US Circuit Court of Appeals is also evaluating the travel ban in a separate appeal. The court has not indicated when it will rule, but the travel ban would not go into effect as long as one nationwide injunction remains in effect.
"It looks increasingly likely that the justices will have to confront the travel ban -- and whether to review today's ruling -- sometime this fall," Vladeck said.
Page Pate, CNN legal analyst and adjunct professor of law at the University of Georgia, said he believed the attempt to revise the executive order "and make it more constitutional apparently has not worked, at least according to this court."
"I think when they revised this ban, they tried to take that all into accounts, and wisely took out any specific references to religious preferences," Pate said on CNN's "Newsroom," "and I thought that made this ban more likely to be upheld ultimately on appeal because it wasn't as facially as unconstitutional as the first travel ban."
Dissent hits use of Trump campaign quotes
Judge Paul Niemeyer, one of the three dissenters, said the majority "looks past the face" of the executive order.
The approach "adopts a new rule of law that uses campaign statements to recast the plain, unambiguous, and religiously neutral text," Niemeyer, a George W. Bush appointee, wrote. "Opening the door to the use of campaign statements to inform the text of later executive orders has no rational limits."
"Unless corrected by the Supreme Court, the majority's new approach, which is unsupported by any Supreme Court case, will become a sword for plaintiffs to challenge facially neutral government actions, particularly those affecting regions dominated by a single religion," he wrote.
Judge Dennis Shedd, meanwhile, said the executive order doesn't fulfill Trump's stated campaign pledge.
"The President's supposed goal of 'banning Muslims' from the United States is not remotely served by the temporary travel pause, a fact that makes the district court's factual finding even more dubious," Shedd wrote.
The administration did win on one point, Vladeck noted. "The only point on which the majority opinion ruled for the President was that the order blocking the ban could not apply to him, personally, but that's a legal technicality that won't actually matter in practice."
The White House did not immediately respond to a request for comment.
CNN's Dan Berman and Miranda Green contributed to this report.
The-CNN-Wire™ & © 2017 Cable News Network, Inc., a Time Warner Company. All rights reserved.