The battle lines seemed drawn in Wednesday’s oral arguments before the U.S. Supreme Court over the legality of President Trump’s third iteration of his controversial travel ban. The ban restricts entry from five majority-Muslim countries, as well as North Korea and Venezuela, on the basis of these countries' alleged vetting deficiencies and security risks.

The conservative-leaning high court signaled in December that it might ultimately rule for Trump when it allowed the latest ban to go into effect while considering its challenges, and legal experts said today’s grilling by the justices further portends a victory for the administration.

Solicitor General Noel Francisco argued on behalf of the administration that the ban issued by presidential proclamation in September was the result of a "worldwide multi-agency review" based on "foreign policy judgment" rather than religious animus. He asserted it is not a “Muslim ban” because it excludes "almost all the majority-Muslim world."

Justice Sonia Sotomayor, a President Obama appointee, questioned whether the ban violates immigration laws that set forth how foreigners are vetted while giving the president some authority to suspend the entry of aliens whose admissions he finds “detrimental to the interests” of the United States. “I thought that Congress had looked at the situation and created a statutory system that addressed the very concern the President is expressing,” Sotomayor said.

Sotomayor and Justice Stephen Breyer also expressed concerns that there was insufficient transparency in the current ban and that its waiver exceptions might be just "window dressing."

Justice Elena Kagan, another Obama appointee, posed a provocative hypothetical: “So let's say in some future time a President gets elected who is a vehement anti-Semite and says all kinds of denigrating comments about Jews...." He then asks his staff to issue a proclamation that dots all the i’s and crosses all the t’s and “in the context of this virulent anti-Semitism -- what emerges is a proclamation that says no one shall enter from Israel.” Francisco responded that in that scenario challengers could have a constitutional argument that the ban is discriminatory.

Kagan said that “this is an out-of-the box president” and after a micro-pause added “in my hypothetical,” which drew laughs across the gallery.

Francisco urged the court not to focus on the words of Donald Trump the candidate, like when he said in December 2015: “I Donald Trump call for a complete ban of Muslims entering the United States.” When the president-elect takes the oath of office, it “marks a fundamental transformation," Francisco said. "This is not a so-called Muslim ban. If it were, it would be the most ineffective Muslim ban that one could possibly imagine,” he stated.

Neal Katyal, the attorney for the state of Hawaii which is challenging the ban, argued that it is illegal because it conflicts with Congress’ immigration scheme and unconstitutionally discriminates against Muslims. If upheld, the order allows the president “to take an iron wrecking ball” to our immigration statutes and would “give the president a power that hasn’t been given in one hundred years.”

Katyal claimed that Trump’s own words prove the ban rests on religious animus. As president, Trump could have “easily moved away” from statements he made as a candidate, “but instead he embraced them."

In his rebuttal to the court, Francisco insisted that the president has no ill-will towards Muslims: "He has made crystal clear that Muslims in this country are great Americans and there are many, many Muslim countries who love this country and he has praised Islam as one of the great religions of the world." This travel ban, he said, is "what it says it's about: Foreign policy and national security."

Conservative Justices John Roberts and Samuel Alito, along with Justice Anthony Kennedy – who often provides the court’s key swing vote – pressed Katyal on why the president cannot ban immigrants for national security purposes.

Alito asked Katyal “can you imagine any situation in which the threat of the infiltration of the United States by terrorists was so severe” to justify a ban, to which Katyal said “yes” but that after 460 days of this current order, we have not yet seen sufficient justification for it.

But Roberts rebutted that the president might have information from the military that Congress does not have, adding: “Imagine, if you can, that Congress is unable to act when the President asked for legislation,” eliciting laughs.

Kennedy, who could be the decider in this contentious case, also seemed skeptical of Katyal's insistence that the ban is indefinite or "perpetual," pointing out that the order provides for a reassessment after 180 days.

But Kennedy also pressed Francisco on the argument that the Court shouldn't look to campaign statements.

According to ABC News Supreme Court contributor Kate Shaw, "If the Court reaches the question of whether this Proclamation violates the Constitution, it seems to me there's a very good chance Justice Kennedy would find it unconstitutional, based in part on the president's statements."

The Supreme Court is expected to rule at the end of June.

ABC News' Audrey Taylor contributed to this report.