A federal judge has ruled the Trump administration has the authority to waive environmental rules as it seeks to construct a border wall with Mexico.

Judge Gonzalo Curiel handed the administration a victory on one of Donald Trump’s central campaign promises – a ruling that was all the more striking because Mr Trump had disparaged Mr Curiel’s ability to be unbiased because of the American judge’s Mexican heritage.

California and an array of environmental groups filed legal challenges last year to the administration’s effort to expedite the wall’s construction by circumventing a variety of statutes. In announcing the lawsuit, California Attorney General Xavier Becerra suggested Donald Trump had sought to “ignore the law”.

Mr Curiel’s acknowledged he was ruling on a politically freighted case, writing in his decision that the wall was the “subject of heated political debate…as to the need, efficacy and the source of funding for such barriers”, but said he was not weighing in on whether “underlying decisions to construct the border barriers are politically wise or prudent”.

“It is not our job to protect the people from the consequences of their political choices,” Mr Curiel wrote, quoting Supreme Court Chief Justice John Roberts.

Department of Justice spokesman Devin O’Malley hailed the decision as helping to advance “ important work vital to our nation’s interests.”

“Border security is paramount to stemming the flow of illegal immigration that contributes to rising violent crime and to the drug crisis, and undermines national security,“ Mr O’Malley said in a statement.

Mr Becerra responded to the ruling by saying the California Department of Justice would “evaluate all of our options”.

“We remain unwavering in our belief that the Trump Administration is ignoring laws it doesn’t like in order to resuscitate a campaign talking point of building a wall on our southern border,” Mr Becerra said in a statement.

During the presidential campaign, Mr Trump called Mr Curiel – who was then overseeing class-action lawsuits against Trump University – “very hostile” and repeatedly referred to the Indiana-raised judge’s Hispanic roots

“We are building a wall. He’s a Mexican. We’re building a wall between here and Mexico,” Mr Trump said during a June 2016 interview.

“This judge is giving us unfair rulings. Now, I say. ‘Why?’ Well, I’m building a wall, OK? And it’s a wall between Mexico. Not another country,” Mr Trump added.

Trump claims that American judge’s ‘Mexican heritage’ resulted in unfair treatment during 2016 lawsuit

Debate over the wall has continued to smoulder in Washington. While the Trump administration requested $18bn (£13bn) for the structure’s first phase earlier this year, Congress has not yet allocated money to construct a border barrier.

The wall’s fate has also become entangled in a broader immigration fight. Mr Trump has sought to extract a deal for more border security funding in exchange for opening a path to citizenship to young immigrants who are in the country illegally. He moved to end a programme that offered them temporary legal status.