(CN) — The Supreme Court agreed Monday to hear the Trump administration’s challenge of orders finding it had unlawfully transferred $2.5 billion in Defense Department funds for border wall construction.

In what could be the final months of his presidency, Donald Trump’s administration is working furiously to fulfill his 2016 campaign promise of walling off the Southwest border.

According to U.S. Customs and Border Protection, since Trump took office in January 2017 the government has built 371 miles of new border wall, with 326 miles replacing existing wall and just 45 miles where no barriers were before. All told, the Trump administration has secured $15 billion to construct 738 miles of border wall.

The Supreme Court on Monday agreed to decide if the Trump administration violated the appropriations clause of the U.S. Constitution in diverting $2.5 billion from the Pentagon’s coffers to pay for the wall, as the Ninth Circuit held last year. Per their custom, the justices did not comment on the decision to take up the case.

Trump’s focus on the project led to the longest government shutdown in U.S. history – 35 days ending Jan. 25, 2019 – after Congress refused his demand for $5.7 billion for wall construction.

“I am proud to shut down the government for border security,” Trump said in a December 2018 meeting with Senate Minority Leader Chuck Schumer and Speaker of the House Nancy Pelosi.

With Congress refusing to budge, the Trump administration did an end-around, declaring drug smuggling across the border a national emergency in February 2019. This allowed the Department of Defense to transfer $2.5 billion which had been earmarked for other purposes to wall construction under Sections 8005 and 9002 of the 2019 Department of Defense Appropriations Act.

Twenty states, led by California, sued over the transfer. They claimed the Trump administration exceeded its authority under Section 8005 because it does not permit the transfer of funds after the request has been denied by Congress.

The states also claimed the wall would harm the environment and possibly put some species on the path towards extinction by cutting their access to food, water and mates. They further alleged the wall trampled their sovereign interests in enforcing their environmental statutes. The Sierra Club and Southern Border Communities Coalition made similar claims in a separate lawsuit.

In a pair of 2-1 rulings issued in June, the San Francisco-based Ninth Circuit agreed with lower court orders that had found the funding reallocation illegal.

In its petition for review to the Supreme Court, the Trump administration claims the 20 states and environmental groups lack standing to challenge the fund transfer because their environmental and sovereignty concerns have nothing to do with the budgetary process between the Department of Defense and Congress.

Dror Ladin of the American Civil Liberties Union represents the Sierra Club and Southern Border Communities Coalition. He said he is looking forward to arguing the case before the Supreme Court and “finally putting a stop to the administration’s unconstitutional power grab.”

“Everyone knows that Trump failed to get Congress to fund his xenophobic wall obsession, and every lower court that has considered the case has found that the President has no authority to waste billions of taxpayer dollars on construction,” he said in a statement.

The Justice Department did not immediately respond to a request for comment Monday.

The high court’s decision to hear the case comes 10 days after the Ninth Circuit found in another 2-1 ruling on Oct. 9 the Trump administration had violated Congress’ exclusive control of appropriations by diverting $3.6 billion from military construction projects to fund construction of the border wall.