Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal appeals court Thursday upheld one of two bans on enforcing President Donald Trump's executive order restricting travel from six predominately Muslim countries.

The Fourth Circuit Court of Appeals, based in Richmond, Virginia, voted 10-3 to uphold a ruling by a federal judge in Maryland who declared in March that the president's revised travel order amounted to unconstitutional religious discrimination.

People gather to protest against the travel ban imposed by U.S. President Donald Trump's executive order, at O'Hare airport in Chicago on Jan. 28. Kamil Krzaczynski / Reuters

Campaign statements by Trump, who originally called for a ban on Muslim immigration, "provide direct, specific evidence" of what motivated his executive orders — "President Trump's desire to exclude Muslims from the United States," the appeals court said.

The revised executive order "cannot be divorced from the cohesive narrative linking it to the animus that inspired it," the court said in an opinion written by Chief Judge Roger Gregory.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The Justice Department urged the court to lift the ban on enforcement. It said the executive order had a legitimate national security purpose, allowing the government to assess the reliability of background information on visa applicants from six countries associated with terrorism.

But that argument, the court said, "is belied by evidence in the record that President Trump issued the first executive order without consulting with the relevant security agencies."

After Trump's first executive order was blocked in court, the president signed the second one, imposing a 90-day ban on travel from Iran, Sudan, Syria, Libya, Somalia, and Yemen.

Judge Paul Niemeyer, writing in dissent for himself and Judges Dennis Shedd and Steven Agee, said the majority wrongly gave itself the power to "search for evidence suggesting bad faith."

As for the government's claim that the president acted to protect national security, the dissenters said "none of the facts or conditions recited as reasons for the issuance of the executive order have been challenged as untrue or illegitimate."

U.S. Attorney General Jeff Sessions said in a statement Thursday that the Justice Department "strongly disagrees" with the decision and would be seeking a review of the case in the Supreme Court.

Sessions added that the president's executive order was "well within his lawful authority to keep the nation safe.”

"As the dissenting judges explained, the executive order is a constitutional exercise of the President’s duty to protect our communities from terrorism," Sessions said. "The president is not required to admit people from countries that sponsor or shelter terrorism, until he determines that they can be properly vetted and do not pose a security risk to the United States.”

It is unlikely the justices would hear the case before the fall.

In addition to the Maryland judge's ruling, the subject of Thursday's appeals court ruling, the executive order was also blocked by a federal judge in Hawaii. The Ninth Circuit Court of Appeals heard oral arguments May 15 on the government's efforts to lift that stay.

Both appeals courts would have had to rule in the administration's favor to allow enforcement of the revised executive order.

The American Civil Liberties Union, which is representing a group of refugee aid organizations and Muslim residents whose overseas relatives are seeking visas, declared victory on Twitter after the announcement, saying, “We won in 4th circuit Muslim ban case!”