President Donald Trump announced Wednesday his administration will roll back a waiver to the Clean Air Act dating back to 1968 that allows the state of California to set higher emissions standards for cars than the federal government does.

The move is going to cause more headaches for an auto industry already buffeted by the Trump administration’s trade war with China. California officials have promised to challenge the revocation in court; state Attorney General Xavier Becerra said Trump had “no basis and no authority” to revoke the waiver.

Trump isn’t just igniting yet another fight with California, a blue state he has often feuded with. The waiver revocation is also part of his administration’s longstanding attempt to roll back federal fuel economy standards for cars and light trucks. Californians buy more cars than people in any other state, which means the emissions standards it sets for itself have big repercussions on the US economy as a whole. Thirteen states and the District of Columbia have also adopted California’s vehicle emissions rules.

So the California waiver was a big impediment to the Trump administration’s larger goal of rolling back regulations that were implemented to combat climate change.

In a string of Wednesday tweets announcing the rollback, Trump claimed it would make cars cheaper and safer, despite concerns from EPA officials that they could actually slightly increase highway deaths.

“There will be very little difference in emissions between the California Standard and the new U.S. Standard, but the cars will be far safer and much less expensive,” Trump tweeted. (There’s a double-digit difference between the miles-per-gallon target for 2026 by California and Trump’s EPA; 51 miles per gallon, compared to 37 miles per gallon).

And a subsequent Trump tweet carried what sounded like a threat to automakers if they don’t comply: “Automakers should seize this opportunity because without this alternative to California, you will be out of business.”

The Trump Administration is revoking California’s Federal Waiver on emissions in order to produce far less expensive cars for the consumer, while at the same time making the cars substantially SAFER. This will lead to more production because of this pricing and safety...... — Donald J. Trump (@realDonaldTrump) September 18, 2019

....far safer and much less expensive. Many more cars will be produced under the new and uniform standard, meaning significantly more JOBS, JOBS, JOBS! Automakers should seize this opportunity because without this alternative to California, you will be out of business. — Donald J. Trump (@realDonaldTrump) September 18, 2019

California state officials made it clear they don’t plan to accept the revocation of their waiver without a fight.

“It’s a move that could have devastating consequences for our kids’ health and the air we breathe if California were to roll over,” said Democratic Gov. Gavin Newsom in a statement. “We will fight this latest attempt and defend our clean car standards.”

Becerra, the California attorney general, agreed.

“We’re ready to fight for a future that you seem unable to comprehend; we’ll see you in court if you stand in our way,” Becerra said in a statement. “While the White House clings to the past, automakers and American families embrace cleaner cars.”

This is part of a longstanding effort from the Trump administration to undo climate change regulations

More than 20 percent of US greenhouse gas emissions come from cars and light-duty trucks, so increasing their efficiency is an important tactic for mitigating climate change.

The Obama administration ramped up these fuel efficiency standards in 2012, but the Trump administration wants to relax them, as it has already done with greenhouse gas emissions regulations for power plants.

However, some auto companies have already said they don’t want the Trump administration’s new fuel efficiency rules. In fact, four car manufacturers — Volkswagen, BMW, Ford, and Honda — in July reached a surprise deal with California air regulators to set higher emissions targets for themselves.

That voluntary deal would put the four auto companies on course to average 51 miles per gallon across all their sales by 2026.

As Vox’s Umair Irfan noted, it’s a slightly weaker standard than the standard the Obama administration set:

The Obama rules restricted tailpipe emissions of carbon dioxide from light-duty vehicles but gave companies several ways to comply. Meeting that target just by increasing fuel economy would have required car companies to average 54.5 miles per gallon across sales of cars, trucks, SUVs, and crossovers by 2025. Some car companies thought this target was too aggressive, so when Trump came to office, these manufacturers petitioned to have the standard revised. But carmakers got way more than they bargained for: The Trump administration decided to freeze mileage standards after 2020, which would hold average fuel economy at just 37 miles per gallon.

The deal between California and Volkswagen, BMW, Ford, and Honda has reportedly rankled Trump and administration officials so much so that they have put pressure on other car companies not to follow suit, per the New York Times.

But while automakers and people concerned about climate change want higher standards, the oil industry does not. As the New York Times reported in December, oil companies are wary of higher fuel efficiency standards, and are making their voices heard in the Trump White House:

The industry had reason to urge the rollback of higher fuel efficiency standards proposed by former President Barack Obama. A quarter of the world’s oil is used to power cars, and less-thirsty vehicles mean lower gasoline sales. In recent months, Marathon Petroleum also teamed up with the American Legislative Exchange Council, a secretive policy group financed by corporations as well as the Koch network, to draft legislation for states supporting the industry’s position. Its proposed resolution, dated Sept. 18, describes current fuel-efficiency rules as “a relic of a disproven narrative of resource scarcity” and says “unelected bureaucrats” shouldn’t dictate the cars Americans drive.

The Trump administration has used a number of different tactics to try to push through their lower standards. First, they’ve tried to personally put pressure on auto companies. (Trump’s tweet telling automakers they’d lose business if they kept working with California appeared to be a continuation of that.)

Second, they’ve been claiming it would make automobiles safer, using the rationale that forcing automakers to meet tougher efficiency rules has the effect of making new cars more expensive — therefore causing people to drive around their old, unsafe cars for longer. Trump’s safety claim, however, is directly at odds with emails from EPA staffers that the AP obtained last year, raising concerns the move could actually slightly increase highway deaths per year.

But before any of this goes into effect, it could find itself tangled up in a long court battle first.

Trump’s move could be on shaky legal ground

Revoking California’s waiver to the Clean Air Act will mark the beginning of a lengthy legal battle between California and the Trump administration, and climate law experts have pointed out the White House is on shaky legal ground.

The administration’s legal argument is that it has “inherent authority” under the federal Clean Air Act to revoke California’s waiver because it goes against the Clean Air Act’s section 209, the specific law for state emissions standards.

But “the Clean Air Act does not contain any waiver revocation authority,” writes Julia Stein, an environmental attorney and project director at the UCLA School of Law. In a recent article, Stein argues the Clean Air Act gives the EPA the ability to deny a waiver before one is already granted, but not after.

In other words, because California was already granted a waiver by a previous administration, Stein says the law says the Trump administration can’t just take it away:

There is no suggestion that Congress intended to create revocation authority, and no such authority has ever been recognized by a court, or otherwise. Even if the section 209 factors did apply in the context of a waiver revocation, the California standards satisfy all of section 209’s requirements: they are at least as stringent as the federal government’s standards, they are necessary to meet compelling and extraordinary conditions that California faces both with respect to air pollution like smog and climate change, and they are consistent with section 202 of the Clean Air Act.

The state of California’s planned challenge the Trump administration’s revocation of their waiver could be a big legal test.