The chances of President Donald Trump’s travel ban going before the Supreme Court increased Friday when a U.S. federal judge in Virginia ruled that the executive order was justified.

The ruling by U.S. District Court Judge Anthony Trenga contradicted those made by federal judges in Hawaii and Maryland earlier this month, although the order remains halted.

The revised travel ban, signed March 6, was blocked from being implemented when the Hawaii and Maryland judges ruled that it violated the establishment clause of the Constitution, based largely on statements from Trump and advisers Rudolph Giuliani and Stephen Miller. Trump called for a complete shutdown of Muslim immigration during his campaign.

Trending: Yemen's President Sentenced to Death by Houthi Court

The travel ban remains suspended, although Friday’s ruling offered a boost to Trump. Trenga ruled that, despite Trump’s past statements, the changes made from the first executive order, notably removing specific references to religion, meant it was not unlawful.

“This court is no longer faced with a facially discriminatory order coupled with contemporaneous statements suggesting discriminatory intent,” he said. “And while the president and his advisers have continued to make statements following the issuance of EO-1 [the first executive order] that have characterized or anticipated the nature of EO-2 [the revised ban] the court cannot conclude for the purposes of the motion that these statements, together with the president's past statements, have effectively disqualified him from exercising his lawful presidential authority.”

The Council on American-Islamic Relations, which backed the complaint, has already said it will appeal the Virginia ruling. But the Justice Department welcomed the news.

Don't miss: U.S. Confirms Coalition Strike Killed as Many as 200 Civilians in Mosul

“As the Court correctly explains, the president’s Executive Order falls well within his authority to safeguard the nation’s security,” department spokesperson Sarah Isgur Flores said.

Story continues

Most popular: Why ISIS is Failing to Build a Caliphate in Afghanistan

Trump has vowed to take the case “as far as it needs to go,” including all the way to the Supreme Court. Trump’s nominee for the vacant seat on the court, Neil Gorsuch, had hearings before the Senate Judiciary Committee this week, during which he was asked whether he thought the travel ban constituted a religious test.

“I'm not going to say anything here that would give anybody any idea how I'd rule in any case like that that could come before the Supreme Court or my court at the 10th Circuit,” he said. “It would be grossly improper of a judge to do that. It would be a violation of the separation of powers and judicial independence if someone sitting at this table, in order to get confirmed, had to make promises or commitments about how they'd rule in a case that's currently pending and likely to make its way to the Supreme Court.”

More from Newsweek