A federal court judge once accused by President Donald Trump of being biased against him because he’s “Mexican” and a “hater” paved the way for construction of a section of Trump’s proposed wall along the U.S. southern border.

U.S. District Judge Gonzalo Curiel in San Diego sided Tuesday with the Homeland Security Department, which asserted authority under federal immigration law to waive compliance with environmental protection statutes because 14 miles of existing fencing near San Diego is “no longer optimal for border patrol operations.”

The government argued in court papers that the law allowing it to sidestep environmental reviews “has been repeatedly upheld in the face of legal challenges.”

California and environmental advocacy groups claimed in court filings that the 1996 immigration law is unconstitutional. They also alleged the lack of environmental reviews would imperil endangered species including the Quino checkerspot butterfly and the Mexican flannel bush and that federal officials failed to consult, as required, with the state and other affected agencies and parties.

California Attorney General Xavier Becerra responded to the ruling by saying “a medieval wall along the U.S.-Mexico border simply does not belong in the 21st century.”

“The administration has violated the rules and we will move forward and proceed with the case as quickly as possible,” he said in an interview while attending a round-table discussion of environmental issues at a meeting of state attorneys general in Washington. “We don’t want the health of the people who would be living by the wall to be affected.”

Trump, who made border security one of the cornerstones of his presidential campaign, has continued to insist that a border wall be constructed. A Justice Department spokesman said the government is pleased the ruling will allow it to move ahead “without delay.”

“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,” spokesman Devin O’Malley said in an email.

Curiel is the judge in San Diego who presided in 2016 over a $25 million settlement to thousands of students who sued the then-candidate and his Trump University over what they said were false claims and misleading advertising about the benefits of the school, which was not accredited.

During the Trump University litigation Trump criticized Curiel’s handling of the case and described him as a “hater” whose Mexican heritage -- he was born in Indiana to Mexican immigrants -- would prevent a fair outcome. The judge hasn’t responded publicly to the president’s comments.

In Tuesday’s ruling, Curiel noted his U.S. roots while referring to the wisdom of U.S. Supreme Court Chief Justice John Roberts, a “fellow Indiana native,” in handling cases “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,” Curiel quoted Roberts saying in a 2012 ruling. “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 had allowed 24 members of the Congressional Hispanic Caucus to file a brief in support of the court order sought by California and the environmental groups against the federal government.

Curiel’s approval of the Trump University settlement was upheld this month by the 9th U.S. Circuit Court of Appeals, which unanimously rejected a challenge to the agreement. Nearly 3,700 class-action plaintiffs will be paid about 90 cents on the dollar of their claims.

The case is Center for Biological Diversity v. U.S. Department of Homeland Security, 17-cv-1215, U.S. District Court, Southern District of California (San Diego).