US President Donald Trump gestures as he speaks to members of the press prior to departing from the South Lawn of the White House in Washington, DC, July 24, 2019. (Photo by Roberto SCHMIDT / AFP)        (Photo credit should read ROBERTO SCHMIDT/AFP/Getty Images)
US President Donald Trump gestures as he speaks to members of the press prior to departing from the South Lawn of the White House in Washington, DC, July 24, 2019. (Photo by Roberto SCHMIDT / AFP) (Photo credit should read ROBERTO SCHMIDT/AFP/Getty Images)
PHOTO: Roberto Schmidt/AFP/Getty Images
Now playing
01:21
Supreme Court rules for Trump in border wall fight
Now playing
02:41
Loyal Texas Trump voters want Biden to be less divisive
Now playing
01:33
Chuck Schumer announces timeline for Trump impeachment
WASHINGTON, DC - JANUARY 22: U.S. President Joe Biden signs an executive order as Vice President Kamala Harris looks on during an event on economic crisis in the State Dining Room of the White House January 22, 2021 in Washington, DC. President Biden spoke on his administration
WASHINGTON, DC - JANUARY 22: U.S. President Joe Biden signs an executive order as Vice President Kamala Harris looks on during an event on economic crisis in the State Dining Room of the White House January 22, 2021 in Washington, DC. President Biden spoke on his administration's response to the economic crisis that caused by the COVID-19 pandemic and signed two executive orders. (Photo by Alex Wong/Getty Images)
PHOTO: Alex Wong/Getty Images North America/Getty Images
Now playing
02:31
Biden zeroes in on the teetering economy in first week
White House senior adviser Kevin Hassett speaks with reporters at the White House, Friday, June 19, 2020, in Washington. (AP Photo/Alex Brandon)
White House senior adviser Kevin Hassett speaks with reporters at the White House, Friday, June 19, 2020, in Washington. (AP Photo/Alex Brandon)
PHOTO: Alex Brandon/AP
Now playing
05:08
Ex-Trump official who supports Biden stimulus plan speaks out
Dick Durbin 0122
Dick Durbin 0122
PHOTO: CNN
Now playing
01:41
Sen. Durbin: We can't pass anything without bipartisanship
JOINT BASE ANDREWS, MARYLAND - JANUARY 20: President Donald Trump boards Air Force One at Joint Base Andrews before boarding Air Force One for his last time as President on January 20, 2021 in Joint Base Andrews, Maryland. Trump, the first president in more than 150 years to refuse to attend his successor
JOINT BASE ANDREWS, MARYLAND - JANUARY 20: President Donald Trump boards Air Force One at Joint Base Andrews before boarding Air Force One for his last time as President on January 20, 2021 in Joint Base Andrews, Maryland. Trump, the first president in more than 150 years to refuse to attend his successor's inauguration, is expected to spend the final minutes of his presidency at his Mar-a-Lago estate in Florida. (Photo by Pete Marovich - Pool/Getty Images)
PHOTO: Pete Marovich/Pool/Getty Images
Now playing
04:20
Former top administration officials lobby to convict Trump
Guard Soldiers were ordered to move from the cafeteria to the parking garage
Guard Soldiers were ordered to move from the cafeteria to the parking garage
PHOTO: Obtained by CNN
Now playing
01:42
Photos show National Guard confined to parking garage
Rep. Alexandria Ocasio-Cortez cpt 0121
Rep. Alexandria Ocasio-Cortez cpt 0121
PHOTO: CNN
Now playing
02:42
Ocasio-Cortez: We still don't feel safe around other members of Congress
mccarthy
mccarthy
Now playing
04:18
McCarthy contradicts himself on Trump's role in insurrection
Now playing
06:30
'Do you feel you were duped?': Burnett presses GOP lawmaker
White House press secretary Jen Psaki speaks during her first press briefing at the White House, Wednesday, Jan. 20, 2021, in Washington. (AP Photo/Evan Vucci)
White House press secretary Jen Psaki speaks during her first press briefing at the White House, Wednesday, Jan. 20, 2021, in Washington. (AP Photo/Evan Vucci)
PHOTO: Evan Vucci/AP
Now playing
01:48
WH press secretary vows transparency and honesty on first day
Now playing
02:30
Pences share a laugh with Vice President Harris and her husband
Now playing
01:12
Kamala Harris sworn in as Vice President
President Donald Trump speaks at Joint Base Andrew on Wednesday, January 20.
President Donald Trump speaks at Joint Base Andrew on Wednesday, January 20.
PHOTO: CNN
Now playing
02:00
See Trump's final message as President as his family looks on
(CNN) —  

The Supreme Court on Friday cleared the way for the Trump administration to use $2.5 billion from the Department of Defense to construct parts of a wall along the southwestern border that the government argues is necessary to protect national security.

The decision allows the Defense Department money to be spent now while a court battle plays out over whether the government had the authority to divert funds that were not appropriated for the wall. The Supreme Court voted 5-4, along ideological lines, to allow the funds to be used while the court appeals proceed.

In a brief order, the court said that it was ruling in favor of the Trump administration before the litigation has played out because the government had made a “sufficient showing” that the challengers did not have the legal right to bring the case.

Three members of the liberal wing of the court – Justices Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan – wrote they would have blocked the funds for now. The fourth member, Justice Stephen Breyer, wrote separately to say that he would have allowed the government to use the funds to finalize the terms for contractors but block the funds from being used for the actual construction.

The Supreme Court’s order is a significant win for Trump, who is likely to use the construction of a wall as a major talking point on the campaign trail. The President celebrated the decision in a tweet Friday evening.

“The United States Supreme Court overturns lower court injunction, allows Southern Border Wall to proceed,” the President tweeted. “Big WIN for Border Security and the Rule of Law!”

The decision overrules a lower court decision that had blocked the transfer of funds while appeals played out. A panel of judges from the 9th Circuit Court of Appeals refused to allow the use of the funds earlier in the month, holding that the challengers were likely to prevail in their case because the use of the funds “violates the constitutional requirement that the Executive Branch not spend money absent an appropriation from Congress.”

The order comes after Trump ended a 35-day government shutdown in February when Congress gave him $1.4 billion in wall funding, far less than he had sought. He subsequently declared a national emergency to get money from other government accounts to construct sections of the wall.

The $2.5 billion had been shifted from various programs including personnel and recruiting, Minuteman III and air launch cruise missiles, E-3 aircraft upgrades and the Afghan security forces training fund. The Pentagon said it was able to move that money due to uncovered cost savings as part of a process known as “reprogramming.” The money was moved into a Defense Department counter-drug account that is authorized to spend money on the construction of border barriers.

Many lawmakers slammed the decision to move the money away from those national security priorities, threatening to strip the Pentagon of its ability to move money around, something the Defense Department has acknowledged would be detrimental.

“We are pleased with the Supreme Court’s decision,” Pentagon spokeswoman Cmdr. Rebecca Rebarich told CNN.

Lawyers for the government had asked the Supreme Court to step in on an emergency basis and unblock the use of the funds while legal challenges proceed in the lower courts.

Solicitor General Noel Francisco noted in court papers that the projects needed to start because the funds at issue “will no longer remain available for obligation after the fiscal year ends on September 30, 2019.” He said that the funds are necessary to permit the construction of more than 100 miles of fencing in areas the government has identified as “drug-smuggling corridors” where it has seized “thousands of pounds of heroin, cocaine and methamphetamine” in recent years.

“Respondents’ interests in hiking, birdwatching, and fishing in designated drug-smuggling corridors do not outweigh the harm to the public from halting the government’s efforts to construct barriers to stanch the flow of illegal narcotics across the southern border,” Francisco argued in the papers, regarding the challenge from environmental groups.

Legal expert Joshua Matz said the decision is a major victory for Trump.

“But the Court did not signal that Trump followed the law. Instead, the majority took a narrow view of who, if anybody, is allowed to challenge Trump’s decision in court,” he said.

It is a loss for critics, including the Sierra Club and the Southern Border Communities Coalition that argued the administration had illegally transferred the funds after Congress denied requests for more money to construct the wall. The groups argued the wall – in areas in Arizona, California and New Mexico – would harm the environment.

The American Civil Liberties Union, representing the groups, argued in court papers against a stay of the lower court ruling, fearful of the wall’s impact on border communities.

“Issuance of a stay that would permit Defendants to immediately spend this money is not consistent with Congress’s power over the purse or with the tacit assessment by Congress that the spending would not be in the public interest,”ACLU lawyers told the court.

The ACLU slammed the decision after it was released Friday evening.

“This is not over. We will be asking the federal appeals court to expedite the ongoing appeals proceeding to halt the irreversible and imminent damage from Trump’s border wall. Border communities, the environment, and our Constitution’s separation of powers will be permanently harmed should Trump get away with pillaging military funds for a xenophobic border wall Congress denied,” said Dror Ladin, a staff attorney with the ACLU’s National Security Project.

This story has been updated.

CNN’s Ryan Browne contributed to this report.