A federal judge whom President Trump suggested would be biased against him because of the judge’s “Mexican” heritage sided with the administration Tuesday in a lawsuit over whether officials could move forward with expedited plans to build a border wall with Mexico.

In a 101-page opinion , U.S. District Judge Gonzalo P. Curiel wrote that the government had the authority to waive environmental laws and proceed with its border wall.

Curiel wrote that he was “aware that the subject of these lawsuits, border barriers, is currently the subject of heated political debate in and between the United States and the Republic of Mexico as to the need, efficacy and the source of funding for such barriers,” but that he could “not consider whether underlying decisions to construct the border barriers are politically wise or prudent.”

The decision granting summary judgment is an unequivocal win for the Department of Homeland Security and the Justice Department, although those who had sued to slow down construction said they would look to a higher court to intervene.

“We intend to appeal this disappointing ruling, which would allow Trump to shrug off crucial environmental laws that protect people and wildlife,” said Brian Segee, a senior attorney at the Center for Biological Diversity, one of the groups suing. “The Trump administration has completely overreached its authority. . . . They’re giving unprecedented, sweeping power to an unelected agency chief to ignore dozens of laws.”

The Department of Homeland Security said it “looks forward to building the wall where our frontline operators say it is needed and in accordance with all applicable laws.”

Justice Department spokesman Devin O’Malley said, “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.”

Advocacy groups and the state of California sued the administration over its plans, arguing that DHS was improperly relying on a years-old immigration law so it could ignore obligations under environmental laws and put Trump’s vision into place quickly. The government argued that the Homeland Security secretary had wide latitude to waive other requirements to improve border security.

California Attorney General Xavier Becerra said, “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. . . . We will evaluate all of our options and are prepared to do what is necessary to protect our people, our values, and our economy from federal overreach. A medieval wall along the U.S.-Mexico border simply does not belong in the 21st century.”

The case had threatened to delay implementation of one of Trump’s signature campaign promises. The president is seeking $25 billion for enhanced border security, including hundreds of miles of new barrier construction. His proposal would extend the physical structure by about 300 miles and replace another 400 miles with more formidable barriers. Right now, about one-third of the 2,000-mile U.S.-Mexican border has some kind of wall or fencing.

The case also was notable for the judge deciding it. Curiel was the judge in an unrelated lawsuit against the now-defunct Trump University, and Trump, on the campaign trail, lashed out at him.

Curiel’s parents were immigrants from Mexico. He was born in Indiana, a point he noted in his latest ruling.

“As fellow Indiana native Chief Justice Roberts observed in addressing a case surrounded by political disagreement: ‘Court[s] are vested with the authority to interpret the law; we possess neither the expertise nor the prerogative to make policy judgments. Those decisions are entrusted to our Nation’s elected leaders, who can be thrown out of office if the people disagree with them. It is not our job to protect the people from the consequences of their political choices,’ ” Curiel wrote.

Nick Miroff contributed to this report.