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 court’s four liberal justices each at least partially dissented on the ruling.

President Trump hailed the news in a tweet, calling it a “Big WIN for Border Security and the Rule of Law!”

The administration had asked the justices earlier this month to temporarily pause lower court rulings that blocked officials from tapping some of the diverted Pentagon dollars for border wall construction.

Solicitor General Noel Francisco argued that the needs of the administration outweighed those of groups like the American Civil Liberties Union 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 9th 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 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.