The Supreme Court has ruled that President Donald Trump can use $2.5 billion of Pentagon funds for a section of wall on the southern border.
There were five votes to four to block a ruling by a federal judge in California that barred President Trump from spending the money on the Mexican wall.
The wall, dividing the US and Mexico, was President Trump’s major campaign promise during the 2016 election.
The constructing of the wall 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.
In a tweet, President Trump described the ruling as a “big victory”.
He tweeted: “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!”
President Trump has argued that a new wall would help to curb illegal immigration, which he says is fuelling crime and placing a strain on the economy.
Democrats say they are in favor of border security but the wall would be expensive and ineffective. They argue that President Trump has manufactured the border emergency and that the wall has become a symbol of Trump’s anti-immigration platform.
On July 26, the US and Guatemala signed a deal, under which migrants from Honduras and El Salvador who pass through Guatemala will be required to stop and seek asylum there first, rather than heading straight for the US.
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”.
President Trump declared an emergency earlier this year, saying he needed $6.7 billion to build the wall as a matter of national security. However, this figure is far short of the estimated $23 billion cost of a barrier along the whole 2,000 miles of border.
Democrats claimed President Trump’s decision to declare an emergency exceeded his powers under the US constitution.
About 20 states, along with groups including the ACLU have filed lawsuits to try and stop the president using the emergency declaration to bypass Congress.
The House of Representatives is also taking legal action to stop the diversion of further funds for the wall project.
According to US authorities, 104,344 people were arrested along the southwest border in June – a 28% drop from the previous month.
The Trump administration claims the decrease is due to new policies with Mexico to curb migration, including increased security on the Mexican side of the border, and the expansion of a scheme that makes asylum seekers wait in Mexico while their cases are being processed.
However, experts say that reduced migration is also typical during the hot summer months.
The number of people detained on the US-Mexico border is far lower when compared with the previous decade.
The number fell in President Trump’s first year but rose again in 2018 – but even before the increase, when migration numbers were at historic lows, Donald Trump described the situation on the border as a national security crisis.
In a major immigration speech in Phoenix, Arizona, Donald Trump has insisted Mexico will pay for a border wall “100%”.
The GOP nominee told a cheering crowd that he would secure the border, and left open the possibility that millions of illegal immigrants be deported.
Hours earlier, Donald Trump met Mexican President Enrique Pena Nieto but said they had not discussed financing the wall.
President Pena Nieto later insisted he had told Donald Trump Mexico would not pay.
There had been speculation that Donald Trump would back off his plan to deport the estimated 11 million undocumented immigrants living in the US.
In his speech in Phoenix, there were conflicting signals about this. The Republican said their fate was not a “core issue” and that deporting “criminal aliens” would be the priority.
“We will treat everyone living or residing in our country with great dignity,” he said.
Later Donald Trump struck a more uncompromising note when he added: “Anyone who has entered the United States illegally is subject to deportation. That is what it means to have laws.”
He said it was the right of the US to choose immigrants that “we think are the likeliest to thrive and flourish and love us”.
Elaborating on that idea, Donald Trump said his “extreme vetting” would involve an ideological test for immigrants applying to live in the US.
“Applicants will be asked for their views about honor killings, about respect for women and gays and minorities, attitudes on radical Islam,” he said.
Donald Trump stormed to an unlikely victory in the Republican primaries partly due to his tough talking on immigration.
In Phoenix he vowed to protect the interests of Americans who he said lose out to new arrivals: “We have to listen to the concerns that working people, our forgotten working people, have over the record pace of immigration and its impact on their jobs, wages, housing, schools, tax bills and general living conditions.”
Donald Trump accused his Democratic rival Hillary Clinton of wanting to grant amnesty to undocumented immigrants and of advocating “open border” policies.
Reacting to Donald Trump’s visit to Mexico, Hillary Clinton said he had “choked” by not asking his hosts to pay for his wall.