A Richmond, Va.-based federal appeals court on Thursday refused to reinstate President Trump's ban on nationals from six majority-Muslim countries from entering the U.S., delivering a major blow to the Trump administration.

The 4th Circuit Court of Appeals said in a 10-3 ruling that Trump's executive order "speaks with vague words of national security, but in context drips with religious intolerance, animus and discrimination."

In delivering the opinion of the court, Judge Roger Gregory wrote that Congress granted the president broad power to deny entry to aliens, but that power is not absolute.

"It cannot go unchecked when, as here, the President wields it through an executive edict that stands to cause irreparable harm to individuals across this nation," he wrote.

In addition to being discriminatory, the court found that the order would delay and disrupt pending visa applications.

The court's decision keeps a Maryland court's order blocking the ban in place.

The government's appeal of that order was heard by the court's full panel of 13 judges.

Though Judge Stephanie Thacker concurred with the court's decision to keep the stay in place, she said she would have not have considered the remarks Trump made about banning Muslims while on the campaign trail. Those comments took centerstage during oral arguments earlier this month as the judges grappled with whether they should be considered.

"While on the campaign trail, a non-incumbent presidential candidate has not yet taken the oath to 'preserve, protect and defend the Constitution' and may speak to a host of promises merely to curry favor with the electorate," she said.

"Once a candidate becomes President, however, the Constitution vests that individual with the awesome power of the executive office while simultaneously imposing constraints on that power."

But Gregory said Trump's order can't be separated from the narrative linking it to the animus that inspired it.

"In light of this, we find that the reasonable observer would likely conclude that EO-2's primary purpose is to exclude persons from the United States on the basis of their religious beliefs," he wrote.

He said the government has repeatedly asked the court to ignore evidence, circumscribe its own review and blindly defer to executive action, all in the name of the Constitution's separation of powers.

"We decline to do so, not only because it is the particular province of the judicial branch to say what the law is, but also because we would do a disservice to our constitutional structure were we to let its mere invocation silence the call for meaningful judicial review," he wrote.

"The deference we give the coordinate branches is surely powerful, but even it must yield in certain circumstances, lest we abdicate our own duties to uphold the Constitution."

In a dissenting opinion which Judges Dennis Shedd and Steven Agee joined, Judge Paul Niemeyer said the lower court "fabricated a new proposition of law - indeed, a new rule - that provides for the consideration of campaign statements to recast a later-issued executive order."

"The district court's approach is not only unprecedented, it is totally unworkable and inappropriate under any standard of analysis," he said.

Niemeyer said further that the majority ignored court precedent and adopted the same new rule of law in considering Trump's campaign statements.

In a dissenting opinion of his own, Shedd argued that the President has broad authority to make national security decisions.

Citing court precedent, he said, "the President is not obligated to disclose his reasons 'for deeming nationals of a particular country a special threat ... and even if he did disclose them, a court would be ill equipped to determine their authenticity and utterly unable to assess their adequacy.' "

While some will celebrate the court's ruling as a victory in the fight for individual civil rights and others will assail it as a defeat for Trump, Shedd said it's shortsighted to ignore its larger implications.

"Regrettably, at the end of the day, the real losers in this case are the millions of individual Americans whose security is threatened on a daily basis by those who seek to do us harm," he said.

"Even if the district court's instinct is correct and no tangible harm directly results from its order enjoining the President from attempting to protect American citizens, the injunction prohibits the government from addressing a serious risk identified by the Attorney General and Homeland Security Secretary; therefore, the security of our nation is indisputably lessened as a result of the injunction."

The Justice Department announced Thursday it will ask the Supreme Court to review the court order blocking the revised travel ban.

Attorney General Jeff Sessions said in a statement that the administration "strongly disagrees" with a federal court's decision to keep the order in place, calling the travel ban "a constitutional exercise of the President's duty to protect our communities from terrorism."

Sessions said the department "will seek review of this case in the United States Supreme Court.

"The government is waiting for the 9th Circuit Court of Appeals to rule on its appeal of a separate order from a Hawaii judge blocking the ban. Arguments in that case were heard on May 15. It typically takes several weeks for the court to issue a decision.

The 9th Circuit ruled against Trump's first travel order after it was blocked by Washington District Court judge. Trump said he revised the order - removing Iraq from the list of banned counties, as well as the indefinite ban on Syrian refugees and language giving preference to religious minorities when the refugee program resumed - to address the court's concerns.

- Updated at 6:15 p.m.