A federal appeals court in San Francisco on Monday upheld the authority of the U.S. Department of Homeland Security to override environmental laws when building border walls.

The 9th U.S. Circuit Court of Appeals said "the plain language" of a 1996 immigration law entitles the department's secretary to waive environmental laws to install barriers and roads along the border.

A three-panel of the court ruled in lawsuits filed by the state of California and several environmental groups to challenge the current construction of prototype walls and 14 miles of replacement fencing in San Diego County and three miles at Calexico in Imperial County.

In 2017, former Acting Homeland Security Secretary Elaine Duke waived 37 federal laws for the San Diego County projects and 27 for the Calexico project. The projects are under way with funding previously approved by Congress.

Center for Biological Diversity attorney Brian Segee said the group is weighing its options for a possible further appeal.

The office of state Attorney General Xavier Becerra said in a statement, "We are disappointed with the ruling, but pleased that the court recognized the Trump Administration does not have unlimited power and that the administration's authority to build a barrier along our border is subject to judicial review."

A two-judge appeals court majority said that while the 1996 law bars the courts from reviewing the waivers themselves, the courts do have the authority to review plans and decisions to build barriers.

Circuit Judge Consuelo Callahan said in a dissent that while she agreed the administration had the right to waive environmental laws, she believes that only the U.S. Supreme Court had the jurisdiction to review such lawsuits.

U.S. Department of Justice spokesman Steven Stafford said, "Congress has given the executive branch significant authority to build physical barriers on our border.

"Today the court has affirmed that authority, and that is a victory for the Trump Administration, for the rule of law, and above all, for our border security," Stafford said.

The appeals upheld a similar ruling in favor of the government by U.S. District Judge Gonzalo Curiel of San Diego.