The US Supreme Court has given President Donald Trump permission to use $US2.5 billion ($NZ3.7bn) of Pentagon funds for a section of wall on the southern border.
The conservative-majority court on a 5-4 vote with the court's liberals in dissent blocked in full a ruling by a federal judge in California barring the Republican president from spending the money on the basis that Congress did not specifically authorise the funds to be spent on the wall project.
The wall is fiercely opposed by Democrats and Mexico's government.
"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!" Mr Trump tweeted just minutes after the court acted.
A brief order explaining the court's decision said the government "made a sufficient showing" that the groups challenging the decision did not have grounds to bring a lawsuit.
In a highly unusual move, Mr Trump on 15 February declared a national emergency in a bid to fund the wall without congressional approval, an action Democrats said exceeded his powers under the US Constitution and usurped the authority of Congress.
The administration has said it plans to redirect $US6.7bn from the Departments of Defence and Treasury toward wall construction under the emergency declaration after failing to convince Congress to provide the money, including the $2.5bn in Pentagon funding.
Congress earlier failed to provide $5.7bn in wall funding demanded by Mr Trump in a showdown in which the president triggered a 35-day partial shutdown of the federal government that ended in January.
The case arose from a challenge to Mr Trump's action brought by Sierra Club, a leading environmental group, and the Southern Border Communities Coalition, a group advocating for people living in border areas.
The challengers have said the wall would be disruptive to the environment in part because it could worsen flooding problems and have a negative impact on wildlife.
US District Judge Haywood Gilliam ruled on 30 May in Oakland, California that the administration's proposal to build parts of the border wall in California, New Mexico and Arizona with money appropriated for the Defence Department to use in the fight against illegal drugs was unlawful. The judge issued an injunction barring use of the Pentagon funds for a border wall.
The administration asked that the injunction barring use of the reprogrammed funds be put on hold pending an appeal but the San Francisco-based 9th US Circuit Court of Appeals declined to do so.