The Ninth Circuit Court of Appeals ruled for the Trump administration Monday in a case challenging its use of waivers to bypass environmental regulations in constructing parts of the border wall.

The state of California and several environmental groups sued President Donald Trump and the Department of Homeland Security (DHS) in September 2017 to stop construction of a border wall prototype and ongoing repairs to 14 miles of an existing barrier in San Diego.

“Under the Illegal Immigration Reform and Immigrant Responsibility Act of 1996 (IIRIRA), the Secretary of the DHS has long had the authority ‘to install additional physical barriers and roads … in the vicinity of the United States border,’” the Ninth Circuit’s opinion states, quoting the IIRIRA.

The IIRIRA grants the secretary of the DHS “the authority to waive all legal requirements” as is “‘necessary to ensure expeditious construction’ of those barriers and roads,” according to the Ninth Circuit.

The Ninth Circuit’s three-judge panel ruled 2-1 in favor of the federal government. The dissenting judge, Consuelo Callahan, wrote that she supported the Trump administration’s argument, but thought the court lacked jurisdiction to review California’s appeal.

In 2017, the DHS waved provisions of the National Environmental Policy Act and the Coastal Zone Management Act, expediting approval to begin construction of the border wall prototype and repairs.

The ruling is Trump’s second legal victory in the case after U.S. District Judge Gonzalo Curiel ruled against California in February 2018. Curiel found that “Congress delegated to its executive counterpart, the responsibility to construct border barriers as needed in areas of high illegal entry to detect and deter illegal entries.”

Trump accused Curiel of being biased against him in an earlier case involving Trump University. Curiel ruled against then-presidential candidate Trump on several points throughout the 2016.

“I think it has to do with perhaps the fact that I’m very, very strong on the border,” Trump told Fox News in February 2016. “Now, he is Hispanic, I believe. He is a very hostile judge to me.”

Trump eventually settled the case for $25 million.