A federal court cleared the way Tuesday for President Trump to build his border wall, ruling that the administration has the power to waive a series of environmental laws to speed up construction.

The state of California and environmental groups had been counting on the lawsuit to derail the border wall and called the decision disappointing.

The ruling is a major boost for the president and is all the more striking because it comes from Judge Gonzalo P. Curiel, whom Mr. Trump famously called biased during the 2016 presidential campaign because of his Mexican heritage.

SEE ALSO: Trump: California border wall will not happen until entire project approved

Judge Curiel said he wasn’t opining on whether a wall was good or bad policy but had to conclude that the government has the power to build it.

“It is not our job to protect the people from the consequences of their political choices,” he wrote in a 101-page ruling.

His decision does not ease fights over land rights, which could delay some construction in areas such as Texas, where much of the border is on private property.

Nor does the ruling grant Mr. Trump funding for the wall. That must come from Capitol Hill, where lawmakers have been sparring over how much to grant, and over what concessions to demand in return — such as a full amnesty for illegal immigrant Dreamers.

But the judge’s ruling does overcome a major legal hurdle that opponents had raised, citing the Trump administration’s intent to waive some three dozen laws to build fencing. Among them are some of the country’s most iconic statutes: the Endangered Species Act, the Clean Water Act, the Clean Air Act, the Religious Freedom Restoration Act, the Antiquities Act, the Native American Graves Protection and Repatriation Act, and the Eagle Protection Act.

California Attorney General Xavier Becerra, the Center for Biological Diversity and Defenders of Wildlife all filed lawsuits, which were consolidated into one case in front of Judge Curiel.

The opponents argued that the waiver laws Mr. Trump is using were unconstitutional and, even if they were legal, they applied only to fencing that was built under Presidents Bill Clinton, George W. Bush and Barack Obama and couldn’t be stretched to Mr. Trump’s plans.

Judge Curiel rejected all those claims.

The Justice Department, which scored a rare victory in district courts on one of Mr. Trump’s immigration proposals, cheered the ruling.

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

The Center for Biological Diversity, one of the plaintiffs, said it will appeal.

“The Trump administration has completely overreached its authority in its rush to build this destructive, senseless wall,” said Brian Segee, an attorney for the center. “This is unconstitutional and shouldn’t be allowed to stand.”

Mr. Trump has proposed 722 miles of new and replacement fencing along the border. A majority of that would be replacing or adding layers to existing fencing, though some 300 miles would be newly fenced, according to reports on plans submitted to Congress this year.

That full project would cost close to $20 billion. A first installment of $1.6 billion has been pending in Congress for a year, but Democrats and some Republicans have balked, saying they don’t see the need for additional barriers.

U.S. Customs and Border Protection, the Homeland Security agency that oversees the Border Patrol, held a contest last year to get ideas for new border wall styles.

Eight prototypes were built and tested in Southern California, with officials looking to see how difficult it was to breach or climb over them.

Mr. Trump will reportedly visit the site next month to inspect the prototypes — though agents in the field say the models are unlikely to have much effect on the types of fencing being built.

The current preferred style is a bollard wall, which allows some visibility between metal slats as high as 30 feet.

The 2018 border plan also calls for levee walls to be constructed along the Rio Grande in Texas.

Texas Attorney General Ken Paxton said he was encouraged by the court’s ruling clearing legal hurdles.

“I think it’s a big decision, because it allows this process to start going forward,” Mr. Paxton said. “My understanding is they’re starting in California. What affects California with border security affects us. So it’s not just like we’re individual states; we’re also a country. So if we have illegal immigration coming through California, it also affects us.”

Homeland Security spokesman Tyler Houlton said walls have proved effective in funneling illegal immigrant traffic — particularly in Southern California and in Yuma, Arizona, where they cut the flow of people and drugs and dramatically reduced the number of assaults on Border Patrol agents.

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

But environmental groups said the impact of border fencing has also been felt.

“Waiving these bedrock and bipartisan laws has resulted in flooding in places like Nogales, where people lost their lives,” said Gloria Smith, managing attorney at the Sierra Club. “The waivers have driven destruction in Native American burial sites. They have killed thousands of species and fragmented habitat.”