The US Supreme Court has said that President Donald Trump can use $2.5 billion (£2 billion) of Pentagon funds for a section of wall on the southern border.
The court ruled by five votes to four to block a ruling by a federal judge in California that barred the president from spending the money on the wall.
The wall, dividing the US and Mexico, was Mr Trump’s major campaign promise during the 2016 election.
It is fiercely opposed by Democrats.
The decision by the Supreme Court means that the money will be used for wall projects in California, Arizona and New Mexico.
The court in California had argued that Congress had not specifically authorized the funds to be used for constructing the wall.
What has the reaction been to the ruling?
US House Speaker Nancy Pelosi said: “This evening’s Supreme Court ruling allowing Donald Trump to steal military funds to spend on a wasteful, ineffective border wall rejected by Congress is deeply flawed. Our Founders designed a democracy governed by the people – not a monarchy.”
The American Civil Liberties Union (ACLU) has vowed to seek an expedited decision from the Ninth Circuit Court of Appeals “to halt the irreversible and imminent damage from Trump’s border wall”.
Gloria Smith, an attorney with environmental group the Sierra Club, which sued to block the funds said: “Today’s decision to permit the diversion of military funds for border wall construction will wall off and destroy communities, public lands, and waters in California, New Mexico, and Arizona.”
Mr Trump declared an emergency earlier this year, saying he needed $6.7bn to build the wall as a matter of national security. However this figure is far short of the estimated $23bn cost of a barrier along the whole 2,000 miles (3,200km) of border.
Democrats claimed Mr Trump’s decision to declare an emergency exceeded his powers under the US constitution.