California’s sweeping deal with four major automakers this week to boost gas mileage standards and cut tailpipe emissions wasn’t the first time the Golden State has outmaneuvered the Trump administration, which has been planning instead to loosen pollution rules for car companies nationwide.

Rather than a one-time tactic, the agreement announced Thursday between the state and Ford, Honda, Volkswagen and BMW is the latest in a growing list of ways that California has blunted, blocked or shut down entirely nearly all of the Trump administration’s major efforts to rewrite environmental policies in California from the moment he took office.

Trump Environmental Protection Agency spokesman Michael Abboud called the agreement with automakers “a PR stunt.”

Yet more than halfway through his term, experts say, the president has had almost no lasting impact on California’s major environmental rules despite making broad promises and appointing former industry officials into top jobs. The reason: California, a quasi-country with 40 million people and the world’s fifth-largest economy, has been aggressively passing its own state laws, filing lawsuits against the federal government and cutting deals with other states and countries to go around the Trump White House.

“California is showing that it is nimble and able to outwit and outlast the administration in Washington,” said Michael Wara, director of the Climate and Energy Policy Program at Stanford University’s Woods Institute for the Environment.

“That’s part of what infuriates the Trump administration,” he added. “People in California are basically saying, ‘We’ll be here when you are gone.’ ”

When former Interior Secretary Ryan Zinke issued a plan last year to open most of the West Coast to new oil drilling, including California, by as soon as 2020, California legislators passed a law nine months later prohibiting construction of all new oil and gas pipelines in state waters up to three miles out to sea along the entire California coastline. Now, oil from any new platforms built off places such as the Sonoma Coast, Big Sur or Malibu can’t be brought to shore.

“Not here, not now,” said former Gov. Jerry Brown, when he signed the measure in September. “We will not let the federal government pillage public lands and destroy our treasured coast.”

Similarly, when Trump pulled out of the Paris Climate Agreement of 194 nations in 2017, Brown began signing deals with dozens of other states and countries to meet the Paris goals anyway. He held an international climate summit in San Francisco last fall and met with heads of state, including Pope Francis, to craft climate agreements.

After Trump released an “America First Energy Plan” shortly after taking office that called for dramatically more coal and oil use but which included almost no mention of solar, wind or other renewable energy, California lawmakers pivoted in the opposite direction.

They passed a new law last fall requiring 100 percent of the state’s electricity to come from solar, wind, hydropower or other carbon-free sources by 2045. And in recent months, other states have followed suit, including Colorado, Washington, New Mexico and Nevada.

Two weeks ago, New York Gov. Andrew Cuomo signed a landmark law that requires 70 percent of New York state’s electricity to come from renewable sources by 2030 and 100 percent of its electricity to come from renewable and carbon-free sources by 2040. The law also commits New York to building huge new offshore wind farms in the ocean and solar farms across the state.

“Local governments and state governments have been taking action all over the country,” said Kathryn Phillips, executive director of Sierra Club California. “It’s kind of been a double-edge sword. On one hand, Trump has given voice to backwards ideas, like expanding coal. But he also has awakened people who want their kids to have a livable world.”

There are numerous other examples. The Trump EPA announced it would drop plans by the Obama administration to ban chlorpyrifos, a pesticide linked to brain damage in children. In May, California’s EPA issued new rules to phase the chemical out statewide. When the Trump administration drafted rules to weaken wetlands protections, California wrote rules to strengthen them.

One bill in Sacramento, which has passed the state Senate, would even require California to follow older federal environmental standards as state policy if Trump successfully phases them out.

To be sure, even as California unravels or stalls Trump’s efforts to dismantle environmental regulations, there are limits.

Enforcement actions by the U.S. EPA against industries that pollute the air and water fell to their lowest level in 30 years last year. The EPA made only 166 referrals for prosecution to the Department of Justice, a drop of nearly 60% from 2011 and 72% decline from 1998. Trump’s current EPA Administrator, Andrew Wheeler, is a former lobbyist for the coal industry.

“There has definitely been a reduction in oversight. That is corrosive.” said Jared Blumenfeld, secretary of the California Environmental Protection Agency.

Blumenfeld, who was West Coast director for the U.S. EPA under President Obama and who once worked for environmental groups such as the Natural Resources Defense Council, said federal inaction on climate change affects California and will leave lasting impacts in other parts of the United States.

“We have as a state been incredibly vigilant and worked to back fill the protections Trump has eroded,” Blumenfeld said. “That being said, the pace and scale of his program of eliminating environmental protections is enormous and is having massive impacts in other states.”

Some observers wondered why automakers this week would sign a voluntary deal with California for tighter rules on their tailpipe emissions when Trump was looking to weaken rules.

Under the deal, automakers agreed to boost the fuel economy of their new vehicle fleets to 50 miles per gallon by 2026, by cutting their greenhouse gas emissions 3.7 percent each year. The agreement is similar to a rule that the Obama administration put in place, but which had a deadline one year earlier.

The Trump administration has been working since last year to undo it and to strip California of its ability under the federal Clean Air Act to set its own tailpipe standards. The four automakers — who make up 30 percent of the U.S. auto market — feared that because California already has sued the Trump administration, that the issue could ping-pong in court for years, hampering their ability to design new car fleets with certainty.

Other countries — from China to Europe — also are demanding cleaner vehicles, noted Fran Pavley, a former state senator who wrote several of California’s landmark climate bills.

“The automobile manufacturers didn’t want to have to make two types of vehicles,” said Pavley, now at USC. “This will become the de facto national policy.”