President Trump's final hope to implement his temporary travel ban targeting six majority-Muslim countries now rests with the Supreme Court. And luckily for him, the justices may prove to be the most receptive audience to his lawyers' arguments.

Federal judges in Hawaii, Washington, California, Maryland, Massachusetts and Virginia have ruled that two versions of his ban, issued Jan. 27 and March 6, violate First Amendment protections of religion. They all concluded that Trump's national security justification for the ban was far outweighed by a clear intent to discriminate against Muslims.

Now Department of Justice lawyers, armed with a series of dissenting opinions from those lower courts, will plead their case before a more conservative court, with the prospect that a majority of justices may embrace their arguments.

In a court filing Thursday, the department argued that a candidate's statements on the campaign trail — in this case, Trump's call for a "Muslim" ban — should not be considered when reviewing a president's actions. And they argued that judicial rulings have long held that presidents are to be trusted when they say they are acting to protect national security.

"There's this long line of immigration law, of precedence at the Supreme Court, that are premised on that kind of reasoning," said Peter Spiro, a professor at the Temple University Beasley School of Law. "If they want to uphold the ban, the opinion writes itself."

At issue is Trump's plan to temporarily ban most travel from Iran, Libya, Somalia, Sudan, Syria and Yemen for 90 days and suspend the entire refugee program for 120 days so the government can improve screening procedures to make sure terrorists don't slip into the country.

Here is a look at some of the issues the high court will grapple with:

SECOND-GUESSING A PRESIDENT

One central question is whether a court is allowed to try and figure out the intent behind a presidential order.

During his campaign, Trump called for a "total and complete shutdown of Muslims entering the United States." Opponents of the ban believe that statement, combined with others made by Trump and aides before and after he became president, is proof that the ban was nothing more than a "Muslim ban."

But is it the role of a court to conduct that kind of analysis? Acting Solicitor General Jeffrey Wall has argued that courts cannot "psychoanalyze" Trump's motivations. If the text of an order is legal, Wall says, courts are not allowed to "look behind" that text to determine intent.

The Department of Justice has pointed to a Supreme Court opinion in Kleindienst v Mandel, a 1972 ruling that found courts cannot "look behind" an act performed by a government employee if there is a "facially legitimate and bona fide reason" for the act.

Five judges from the 9th U.S. Circuit Court of Appeals in San Francisco penned a dissent opinion asking how the majority could ignore that precedent when reaching its ruling to maintain a hold against Trump's first travel ban.

"Even if we have questions about the basis for the President’s ultimate findings — whether it was a "Muslim ban" or something else — we do not get to peek behind the curtain," Judge Jay Bybee, who was appointed to the 9th Circuit by President George W. Bush, wrote for the minority. "So long as there is one 'facially legitimate and bona fide' reason for the President’s actions, our inquiry is at an end."

BANNING TERRITORIES, NOT RELIGION

While candidate Trump called for a "Muslim" ban during his campaign, Justice lawyers argue that he never advocated such a ban as president.

Instead, they say Trump's approach to the issue evolved to the point where he focused on the national security threats from specific territories, not on people's religion. That's why he selected specific countries to ban, not every country where Muslims are predominant, they say.

The first travel ban included a section that gave preference to religious minorities, a provision that Trump said was designed to help persecuted Christians living in the targeted countries. But that section was removed from the revised travel order, which Wall said should settle any doubts about the national security impetus behind the ban.

"The debate over the meaning of the President’s statements only highlights the dangers in 'opening the door' to campaign comments," Wall wrote this week.

Christopher Hajec, director of litigation at the Immigration Reform Law Institute, which has filed briefs supporting the travel ban, said he was shocked to hear liberal judges openly scrutinizing the national security justification outlined in Trump's executive order.

"Courts are totally unequipped to do that," Hajec said. "It's totally out of bounds. I don't think the majority of the Supreme Court is going to make that same mistake."

JUDGING NATIONAL SECURITY CONCERNS

Several judges who struck down the travel ban argued that the administration did not provide a sufficient national security justification to bar 180 million people from entering the U.S.

Judge Barbara Milano Keenan, who was appointed to the U.S. Court of Appeals for the 4th Circuit by President Barack Obama, wrote that Trump's order outlines broad conditions of lawlessness in the six targeted countries, and describes each of them as terrorist safe havens. But Keenan wrote that the government never clearly established a link between conditions in those countries and its residents' likelihood of becoming terrorists.

For supporters of Trump's travel ban, Keenan and other judges were overstepping their authority by even debating the president's national security argument. Wall repeatedly said during oral arguments that no court has ever scrutinized national security arguments made by a sitting president.

U.S. District Judge Anthony Trenga in Alexandria, Va., provided one of the only victories for Trump when he upheld the travel ban in March. Trenga, who was appointed by George W. Bush, wrote that other courts around him were ignoring the fact that the administration made significant changes to the second travel ban to augment its national security justification.

Responding to court rulings against the first ban, the revised ban included a country-by-country outline of conditions on the ground and ties to terrorist organizations. The end result, Trenga argued, was a "detailed justification for the Order based on national security needs."

Judge Dennis Shedd, who was appointed to the 4th Circuit by President George H. W. Bush, went further, pointing to statements by Attorney General Jeff Sessions and Department of Homeland Security Director John Kelly, who argued that the order was needed for national security.

"Shouldn't that be considered?" Shedd asked during oral arguments in May.

Contributing: Richard Wolf in Washington, D.C.