A judge who was taunted by Donald Trump during the presidential campaign has sided with the US president on a challenge to building a border wall with Mexico.

US District Judge Gonzalo Curiel rejected arguments by the state of California and advocacy groups that the administration overreached by waiving laws requiring environmental and other reviews before construction could begin.

The challengers said a 2005 law that gave the Homeland Security secretary authority to waive the reviews had expired. The law exempted Homeland Security from dozens of laws if it deemed a wall to be in national security interests.

Mr Trump berated Judge Curiel during the campaign for his handling of fraud allegations against now-defunct Trump University, suggesting the Indiana-born judge’s Mexican heritage reflected a bias.

Judge Gonzalo Curiel (US District Court via AP, File)
Judge Gonzalo Curiel (US District Court via AP, File)

Judge Curiel mentioned his roots in Tuesday’s ruling when he quoted another native of the state, US Supreme Court Chief Justice John Roberts, who wrote in another case that courts should not make policy judgments.

The chief justice wrote: “It is not our job to protect people from the consequences of their political choices.”

“In its review of this case, the court cannot and does not consider whether the underlying decisions to construct border barriers are politically wise or prudent,” Judge Curiel wrote in his 101-page ruling.

The decision came days after construction began on a 30-foot high barrier in Calexico, California, the administration’s first wall project outside of eight prototypes in San Diego that were completed in October.

The administration has issued three waivers since August, two to build in parts of California and one in part of New Mexico. President George W Bush’s administration issued the previous five waivers, allowing the government to quickly extend barriers to about one-third of the border.

Donald Trump (AP Photo/Evan Vucci)
Donald Trump (AP Photo/Evan Vucci)

The Centre for Biological Diversity was first to sue the Trump administration, with three other groups — the Sierra Club, Defenders of Wildlife and Animal Legal Defence Fund — later filing a lawsuit. California Attorney General Xavier Becerra, a Democrat, was close behind, and Judge Curiel consolidated all three cases.

The Centre for Biological Diversity said in its lawsuit that the waiver authority cannot be interpreted to last forever. California argued that it expired in 2008, when Homeland Security satisfied congressional requirements at the time on how much wall to build.

During two-and-a-half hours of arguments this month, Judge Curiel peppered both sides with questions about the law’s meaning, saying at one point that it “isn’t a model of clarity”.

Mr Trump is seeking 18 billion US dollars to extend the wall as the White House and Congress negotiate an immigration package that would include new spending on border security and grant legal status to young immigrants who were temporarily shielded from deportation under an Obama-era programme, Deferred Action for Childhood Arrivals.

The prototypes in San Diego that were built to guide future designs and the wall replacement in Calexico were previously funded.