The judge whom President Trump Donald John TrumpBiden leads Trump by 36 points nationally among Latinos: poll Trump dismisses climate change role in fires, says Newsom needs to manage forest better Jimmy Kimmel hits Trump for rallies while hosting Emmy Awards MORE once attacked for his Mexican heritage has ruled in favor of the administration in a lawsuit attempting to block Trump's proposed wall on the U.S.-Mexico border.

U.S. District Judge Gonzalo Curiel, whose parents immigrated from Mexico, ruled Tuesday against a legal challenge to the wall over environment waivers granted by the Department of Homeland Security.

The ruling means that the administration will be able to continue waiving the regulations to build barriers on the border.

ADVERTISEMENT

Trump had targeted Curiel during the 2016 presidential race, claiming the judge might be biased against him in a lawsuit over Trump University because of Curiel's Mexican heritage.

Curiel wrote in his ruling that he did not have “serious constitutional doubts” about the administration’s use of the waivers.

“In its review of this case, the court cannot and does not consider whether underlying decisions to construct the border barriers are politically wise or prudent,” he said.

The lawsuit, filed by the state of California last year, argued that the department had improperly waived the National Environmental Policy Act and other immigration and environmental rules to speed up the construction of the wall.

California Attorney General Xavier Becerra Xavier BecerraOVERNIGHT ENERGY: Trump casts doubt on climate change science during briefing on wildfires | Biden attacks Trump's climate record amid Western wildfires, lays out his plan | 20 states sue EPA over methane emissions standards rollback 20 states sue EPA over methane emissions standards rollback Investigation underway after bags of mail found dumped in Los Angeles-area parking lot MORE said in a statement Tuesday that the state is “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.”

“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,” he said. “A medieval wall along the U.S.-Mexico border simply does not belong in the 21st century.”

And Brian Segee, senior attorney for the Center for Biological Diversity, one of the litigants in the suit, said the organization would appeal the decision, calling the waivers "unconstitutional."

"The Trump administration has completely overreached its authority in its rush to build this destructive, senseless wall," Segee said in a statement. "They’re giving unprecedented, sweeping power to an unelected agency chief to ignore dozens of laws and crash through hundreds of miles of spectacular borderlands."

But a Department of Justice spokesman applauded the ruling, saying it will allow “work vital to our nation’s interest.

"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," Devin O'Malley said in a statement. "Congress gave authority to the Department of Homeland Security to construct a border wall without delay to prevent illegal entry into the United States, and we are pleased DHS can continue this important work vital to our nation’s interests.”

DHS acting press secretary Tyler Houlton also celebrated the ruling in a statement to The Hill, saying that walls "have proven to be extremely effective in preventing the flow of drugs and illegal aliens across our borders."

“Simply put — walls work. The Department of Homeland Security looks forward to building the wall where our frontline operators say it is needed and in accordance with all applicable laws," Houlton said.

—Updated at 5:44 p.m.