Border Patrol Agent Eduardo Olmos walks near the secondary fence separating Tijuana, Mexico, background, and San Diego (Gregory Bull/AP)

California took aim Wednesday at one of President Trump’s key campaign promises: building a border wall.

A lawsuit filed by the state to stop construction of the wall argues that Trump and the Department of Homeland Security violated federal environmental standards and unconstitutionally overrode the power vested in states. The move by the country’s most populous state — which has emerged as a global force in the fight against climate change and a center of opposition to the president — is the most recent obstacle Trump faces in fulfilling his promise to build a “big, beautiful wall” along the United States-Mexico border.

“No one gets to ignore the laws,” California Attorney General Xavier Becerra (D) said at a news conference Wednesday. “Not even the president of the United States.”

Becerra stood in front of the existing border fencing at Border Field State Park near San Diego.

U.S. Attorney General Jeff Sessions was also in San Diego on Wednesday, speaking to reporters at a dock where he touted a record number of cocaine seizures by the Coast Guard. Asked by reporters about the lawsuit, he said he expects to prevail in legal challenges to the wall.

“The United States government has the control of that border and a responsibility to secure it,” he said.

The lawsuit comes as Trump is trying to secure funding for the border wall, which a government analysis estimated would cost $21.6 billion and which Democrats and moderate Republicans alike oppose. In August, the Trump administration announced it had chosen four companies to build concrete prototypes of sections of the wall.

Becerra said DHS failed to prepare an environmental-impact statement on the border wall project in San Diego and Imperial Counties and relied on an outdated act to waive state laws that would prevent the construction of the wall. The DHS secretary’s ability to declare new “priority areas” in which the department could waive laws necessary for the construction of “additional physical barriers and roads” to prevent illegal immigration expired in 2008, according to the lawsuit.

The lawsuit comes as private contractors are preparing to build eight prototype sections for the wall in San Diego County.

“In California, that is not going to fly,” Becerra said. “We respect immigration policy. We understand it is a federal matter. But if it happens in our back yard, we demand that it be carried out in the right way, following the rule of law.”

A DHS spokesperson said that “as a matter of policy,” the department would not comment on pending litigation.

UCLA law professor Sean B. Hecht said the state makes “a very plausible case” for stopping construction of the wall.

“There are a bunch of different angles they are pursuing,” said Hecht, who is the co-executive director of the university’s Emmett Institute on Climate Change and the Environment. “In looking at the case, they are making a stronger and more persuasive argument than I anticipated when I first heard about it.”

He added that the lack of details about Trump’s wall make it difficult to gauge how a judge will view the lawsuit.

California Gov. Jerry Brown (D), who has emerged as a vocal opponent of the president, said in a letter to DHS last week that construction would “wreak havoc on an important and well-used commercial corridor.” He and Becerra, who has filed eight lawsuits in recent months challenging various Trump actions, including a suit over the deportation-relief program for immigrants brought to the United States illegally as children, have emerged as leaders of the opposition to Trump policies they think are divisive, illegal and potentially detrimental to the state.

Aides to Becerra told the Associated Press they believe that victory in the lawsuit, which specifically addresses a 15-mile stretch of the border in San Diego and a three-mile stretch in Calexico, Calif., would apply to the entire 2,000-mile border.

A law in 2005 gave the homeland security secretary the ability to waive laws including the National Environmental Policy Act, Clean Air Act and Endangered Species Act to construct border barriers. Since August, the Trump administration has issued two waivers — both in California. But the Becerra lawsuit suggests the government’s power to legally waive the laws expired in 2008.

Four environmental advocacy groups — the Sierra Club, Defenders of Wildlife, Animal Legal Defense Fund and the Center for Biological Diversity — also have sued the federal government to block construction of the wall.

Becerra said that California has the sixth-largest economy in the world because businesses know that the state follows the rules. The president, he said, should do the same.