Nearly four months after initially signing his travel ban, President Trump ’s lawyers were rejected Thursday in their effort to reinstate the ban through a federal appeals court.

The U.S. 4th Circuit Court of Appeals opinion said the travel ban “speaks with vague words of national security, but in context drips with religious intolerance, animus, and discrimination.”

U.S. 4th Circuit Court of Appeals rules against Trump's travel ban »

The court is one of two appeals courts that heard arguments this month over rulings from federal district courts that blocked Trump’s 90-day suspension of travel to the U.S. by nationals of Iran, Syria, Sudan, Libya, Somalia and Yemen.

The U.S. 9th Circuit Court of Appeals also is considering arguments over the travel ban. That case, which originated in a Hawaii federal district court, also resulted in a block on Trump’s 120-day pause on refugee resettlement.

The travel ban now is likely headed to the U.S. Supreme Court.

Here’s what you need to know before that happens.

Rachel Weaver protests against the travel ban outside the office of Immigration and Customs Enforcement on March 16 in Chicago. (Scott Olson / Getty Images)

What’s behind the lawsuits The state of Hawaii and Ismail Elshikh, the imam of the Muslim Assn. of Hawaii, won a national block of Trump’s order on March 15, the day before it was supposed to take effect. Hawaii said the ban would hurt tourism and the state’s university, which recruits from the six countries and has faculty who hail from them. Elshikh, a U.S. citizen, said in the suit that his mother-in-law had applied for a visa to travel to Hawaii to see the family before Trump became president. Elshikh said he fears that, under the travel ban, his mother-in-law couldn’t see him. His suit said the ban stigmatized Muslims and created a perception that their religion was “disfavored.” The Maryland case was brought by immigrants from Syria, Somalia and Iran whose families are in the middle of the visa approval process. It also was filed on behalf of groups that work with refugees. In that case, lawyers from the American Civil Liberties Union and the National Immigration Law Center said the ban would prevent family reunification and discriminate on the basis of religion.

A December 2015 file photo shows U.S. District Judge Derrick Watson in Honolulu. (George F. Lee / AP)

Lower-court judges have been scathing In Hawaii, U.S. District Judge Derrick K. Watson, an Obama appointee, said Trump appeared to violate the Establishment Clause of the U.S. Constitution by discriminating against Muslims. As proof, Watson cited Trump’s campaign promise to suspend Muslim immigration and his defense of his travel order as president. He pointed to an interview Trump gave to the Christian Broadcast Network in January after the first travel ban saying he would give preference to Christian refugees. That version of the travel order later was struck down in the courts and revised. “The illogic of the government’s contention is palpable,” Watson wrote in his opinion, rebutting government arguments that the travel ban didn’t target Muslims. “The notion that one can demonstrate animus toward any group of people only by targeting all of them at once is fundamentally flawed.” The opinion came out on March 15, the day before the revised travel ban was set to go into effect. Reacting to Watson while at a Nashville campaign rally, Trump said he preferred the original travel ban. He said the revised one was simply a “watered-down” version of the old one. In his 43-page ruling, which landed March 16, U.S. District Judge Theodore Chuang said there were “strong indications that the national security purpose is not the primary purpose for the travel ban.” He said it was “likely” that Trump’s ban violated the Constitution by discriminating against Muslims.

https://twitter.com/realDonaldTrump/status/825692045532618753

https://twitter.com/realDonaldTrump/status/827996357252243456

https://twitter.com/realDonaldTrump/status/857177434210304001

But Trump’s defense has stayed the same

The federal government says that Trump has wide authority over matters of national security and that his order was intended to prevent potential terrorists from getting into the United States.

The order cited two instances in which nationals from the targeted countries were part of terrorism in the U.S.

In January 2013, two Iraqis who came to the U.S. as refugees in 2009 were sentenced to life for terrorism-related activity. The new order, however, excluded Iraq from the ban.

The revised order also mentioned the case of a native of Somalia who was brought to the U.S. as a refugee. After later becoming a citizen, the immigrant was sentenced in 2014 to 30 years in prison for attempting to use a weapon of mass destruction during a Christmas tree-lighting event in Portland, Ore.

“It would be far less disruptive to uniformity — and more respectful of the Constitution’s allocation of authority over immigration to the political branches — to leave the order’s nationwide policy in place, with individualized exceptions for any particular persons who plaintiffs demonstrate suffer cognizable and irreparable injury,” government lawyers wrote in a brief to the 4th Circuit in April.

Government lawyers also have argued that Trump’s statements and those of his associates on suspending Muslim immigration shouldn’t be used to judge the travel ban. Unlike the first ban, Trump’s revised order does not refer to a person’s status as a “religious minority” or mention any religion by name.

Facebook Chief Executive Mark Zuckerberg speaks during the keynote address at the F8 Facebook Developer Conference in San Francisco on April 12, 2016. (Eric Risberg / AP)

Meanwhile, third parties have piled on Hundreds of groups and individuals have filed dozens of briefs in support of or against the travel ban in federal appeals and district courts. They include states and cities, tech companies, former national security officials, universities and civil rights groups. In addition, at least 165 members of Congress have urged courts to keep blocking the ban. More groups have filed briefs against Trump’s order than for it. The list below is a sampling of the filings from both sides. Against the ban Maryland, California, Connecticut, Delaware, Illinois, Iowa, Maine, Massachusetts, New Mexico, New York, North Carolina, Rhode Island, Oregon, Vermont, Virginia, Washington, District of Columbia

Los Angeles, New York, Philadelphia, Minneapolis, Pittsburgh, St. Louis, San Francisco and Seattle

Microsoft, Facebook, Google, Uber, Twitter, Lyft, Yahoo and Airbnb

Madeleine Albright , Leon Panetta and James Clapper For the ban Alabama, Arizona, Arkansas, Florida, Kansas, Louisiana, Mississippi, Montana, Oklahoma, South Carolina, North Dakota, South Dakota, Tennessee, Texas, West Virginia

Gun Owners Foundation, U.S. Border Control Foundation, English First Foundation, Citizens United Foundation, Conservative Legal Defense and Education Fund, Southeastern Legal Foundation, Alliance Defending Freedom, the American Center for Law and Justice

Justin Cox of the National Immigration Law Center, center, stands with Omar Jadwat of the American Civil Liberties Union outside the federal courthouse in Greenbelt, Md., after a hearing over the travel ban on March 15. (Manuel Balce Ceneta / AP)

Lawyers have made their cases

Career attorneys from the Department of Justice faced off in May against civil rights lawyers fighting the travel ban. Many government attorneys are working on both appeals. The full list of attorneys for the cases is longer than what’s below. Jeffrey B. Wall of the Department of Justice, Omar C. Jadwat of the American Civil Liberties Union and Neal K. Katyal of the Hogan Lovells law firm presented oral arguments in the courts.

For the ban Wall, acting solicitor general

Chad A. Readler, acting assistant attorney general

Rod J. Rosenstein , deputy attorney general

, deputy attorney general August E. Flentje, special counsel to the assistant attorney general

Elliot Enoki, acting U.S. attorney

Against the ban 9th Circuit: Katyal, a former acting solicitor general under President Obama; Douglas Chin, Hawaii attorney general

4th Circuit: Jadwat, American Civil Liberties Union; Justin Cox, National Immigration Law Center

Protesters who support the travel ban stand across the street from the #NoBanNoWall protesters at Los Angeles International Airport on Feb. 4, 2017. (Marcus Yam / Los Angeles Times)

But the decision rests with judges — and likely the Supreme Court

In an unusual move, nearly all 4th Circuit appeals court judges — instead of the usual three-judge panel — heard the travel ban case in the 4th Circuit in May. The full court is composed of 15 judges, the majority of whom were appointed by Democrats.

But two judges didn’t participate. The most prominent Republican appointee to the court, Judge J. Harvie Wilkinson III, recused himself because his son-in-law, Acting U.S. Solicitor Gen. Jeffrey B. Wall, represented Trump. Judge Allyson K. Duncan, an appointee of President George W. Bush, also did not join.

In its 10-3 majority opinion, Chief Judge Roger L. Gregory said the travel order “stands to cause irreparable harm to individuals across the nation.”

“The question for this Court, distilled to its essential form, is whether the Constitution ... remains ‘a law for rulers and people, equally in war and in peace,’ ” he wrote. “And if so, whether it protects Plaintiffs’ right to challenge an Executive Order that in text speaks with vague words of national security, but in context drips with religious intolerance, animus, and discrimination.”

Former President Bill Clinton appointed the three 9th Circuit judges who heard arguments in the Hawaii case on May 15. They were Judges Michael Hawkins and Ronald Gould, both considered to be moderates, and Richard Paez, who is viewed as liberal to moderate.

The court has not issued its opinion on the case, which looks not only at the travel ban but at Trump’s attempt to block refugee resettlement for 120 days.

Last month, the 9th Circuit rejected Hawaii’s request for it to skip the three-judge panel and convene an 11-judge “en banc” panel to consider arguments over the travel ban. It did not provide any details about its reasoning.

jaweed.kaleem@latimes.com

maura.dolan@latimes.com

UPDATES:

May 25, 12:45 a.m.: This article was updated with news of the 4th Circuit Court of Appeals ruling against the travel ban.

This article was originally published at 12:15 p.m. on May 8.