The Supreme Court on Friday ruled that the Trump administration can start using military funds to construct a wall on the southern border, handing the president a major legal victory.

The ruling allows the administration to use $2.5 billion in military funds to begin construction of a wall along the U.S.-Mexico border while litigation plays out. A lower court had issued an injunction blocking officials from using those funds.

ADVERTISEMENT The Supreme Court's four liberal justices each at least partially dissented on the ruling Friday.

In an unsigned order, justices said they ruled in favor of the administration partly because “the Government has made a sufficient showing at this stage that the plaintiffs have no cause of action to obtain review” of the administration’s compliance with the federal statute invoked to divert the military funds.

Wow! Big VICTORY on the Wall. The United States Supreme Court overturns lower court injunction, allows Southern Border Wall to proceed. Big WIN for Border Security and the Rule of Law! — Donald J. Trump (@realDonaldTrump) July 26, 2019

Solicitor General Noel Francisco argued that the needs of the administration outweighed those of groups like the ACLU and Sierra Club who are challenging the use of the Defense Department funds for the wall. And he said that if the funds remain frozen until the end of the fiscal year, authorities may not be able to use them at all.

U.S. District Judge Haywood Gilliam in California, an Obama appointee, issued a permanent injunction blocking officials from utilizing $2.5 billion of the roughly $6 billion in diverted military dollars, siding with the groups' arguments that building the wall would cause "irreparable harm" to their interests at the border.

And the Ninth Circuit Court of Appeals, in a 2-1 ruling earlier this month, declined to temporarily halt that injunction, finding that “the use of those funds violates the constitutional requirement that the Executive Branch not spend money absent an appropriation from Congress."

Trump declared a national emergency earlier this year to reallocate the military funds for the border wall. That move followed a record 35 day-long partial government shutdown, as lawmakers from both parties refused to give Trump his requested amount of funds for border security.

House Democrats also attempted to sue to stop the diversion of the Pentagon dollars for a wall, claiming that only lawmakers can allocate federal funding under the Constitution.

But U.S. District Judge Trevor McFadden in D.C., a Trump appointee, found that the lawmakers did not have the standing to bring forward the suit. That ruling is currently being appealed.

Updated: 9:34 p.m.