President Donald Trump is finally making good on his longstanding threat to kill California’s car pollution rules, but to do that he’ll have to run a daunting legal gauntlet.

Trump tweeted on Wednesday morning that his administration is revoking California’s right to set its own pollution standards for cars. In response, California leaders promised to fight Trump’s decision in court.

“This is the fight of a lifetime for us,” said Mary Nichols, a senior air quality regulator in California, at a press conference with California’s governor and attorney general in Sacramento on Wednesday. “We have to win this, and I believe we will.”

It’s a critical fight for the world, because every car maker selling to the United States has been meeting California’s low-pollution standards, which has made America’s overall vehicle emissions much lower than they would otherwise be. And it’s a critical fight for California because the state has more cars than any other, and the pollution from all those cars disproportionately affects residents. That’s why former California governor Ronald Reagan negotiated in 1967 to have a waiver included in the Clean Air Act that would allow states to set their own tailpipe-pollution rules as long as they are more stringent than the federal standards. The EPA is expected to formally revoke that waiver on Wednesday afternoon or Thursday.

“Our leaders made sure that when the Clean Air Act was passed it didn’t make Californians settle for lower air quality standards than the ones we used to beat back smog,” said Mike Sweeney, executive director for the Nature Conservancy’s California chapter, in a statement. “That’s what the waiver is all about.”

In a series of tweets, Trump argued that car prices would fall after he lowered the pollution standards and that the lower prices would allow people to upgrade to newer, more environmentally friendly vehicles.

That’s not what will happen, according to modeling done by the nonpartisan climate policy think tank Energy Innovation. Revoking California’s waiver will cost consumers up to $160 billion through 2050, increase greenhouse gas emissions by millions of tons per year, and make drivers buy more than 2 billion additional barrels of petroleum a year, Energy Innovation concluded.

Trump’s real reason for trying to revoke this waiver is to increase oil sales, said California Governor Gavin Newsom at the press conference.

“This is about the oil industry … The oil industry has wanted to get rid of this waiver for years and years,” he said.

It’s unclear what legal arguments the Trump administration will marshal to challenge the state’s right to set more stringent tailpipe emission rules under the Clean Air Act. Another nonpartisan think tank, the Institute for Policy Integrity, published a lengthy analysis of the potential legal arguments last year, concluding that the Trump Administration would be venturing into dangerous territory.

“This attempt to revoke California’s authority has no legal basis, and it is an affront to the well-established rights of California and more than a dozen other states,” said Richard Revesz, director of the Institute for Policy Integrity, in a statement Tuesday. “The Trump administration seems to be dead-set on taking on this fight regardless of the law or the harm that legal uncertainty will cause automakers.”

So far, California’s attorney general, Xavier Becerra, has maintained a near-perfect batting average as he has swatted back Trump’s attempts to dismantle environmental protections. As he gestured toward Becerra, Newsom said, “The good news is that we’ve got a great legal mind here, and a legal team, and we are winning…. We are winning because we have the law, science, and facts on our side.”