President Trump on Wednesday tweeted a defense of his administration’s weakening of fuel economy standards for cars and light trucks, citing safety benefits. It’s a change that automakers have already said they don’t want. And according to internal emails from the Environmental Protection Agency released in 2018, the rule change would increase highway fatalities.

In fact, four car companies — Volkswagen, BMW, Ford, and Honda — signed a surprise deal with the state of California earlier this summer to set stricter mileage rules for themselves than what the Trump administration proposed.

My proposal to the politically correct Automobile Companies would lower the average price of a car to consumers by more than $3000, while at the same time making the cars substantially safer. Engines would run smoother. Very little impact on the environment! Foolish executives! — Donald J. Trump (@realDonaldTrump) August 21, 2019

According to the New York Times, this sudden side deal with California so infuriated the White House that a senior official summoned leaders from Toyota, Fiat Chrysler, and General Motors in July to pressure them to support the administration’s policy.

But once the deal was announced, several other car companies said they were open to signing on as well. Mercedes-Benz is now preparing to join the California accord, the New York Times reported.

The California agreement would put car companies on course to average 51 miles per gallon across all their sales by 2026. This is weaker than the standard set under President Obama, but much stronger than Trump’s proposal.

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 state of California, which has a waiver from federal rules to set its own emissions standards, said it wanted to uphold the Obama benchmark. In response, the EPA threatened to revoke California’s waiver.

That put California and the federal government on a collision course, with car manufacturers in the middle. California is the largest market for new cars in the United States, so it’s impossible for carmakers to ignore. Another 13 states and the District of Columbia have also adopted California’s vehicle emissions standards.

So auto companies were faced with the prospect of having two very different standards to meet across the country, or having to wait for the dust to settle from what was sure to be a long, messy legal fight.

To justify the rollback, the Trump administration has cited safety as its main concern. The reasoning is that new cars are safer than old cars, but forcing carmakers to meet tougher efficiency rules makes new cars more expensive. That means people end up driving their older, less safe cars for longer, according to the EPA’s published analysis.

The EPA publicly said the Trump rule change would save 1,000 lives per year, but an internal email from staffers obtained by the Associated Press showed that they expected the revision to actually increase highway deaths by 17 per year, undermining the EPA’s bizarre rationale.

Increasing fuel economy is an important tool for limiting air pollution and reducing greenhouse gas emissions. The transportation sector is now the largest source of carbon dioxide in the United States. Cars and trucks account for about 20 percent of all US carbon emissions.

So why is the Trump administration so insistent on relaxing a regulation beyond what the auto industry wants? Because oil producers want cars and trucks to use more fuel. As the New York Times reported in December, oil companies see higher fuel efficiency standards as a threat:

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.

But as the recent California deal shows, car companies would prefer to have stable regulations, even if it means a tougher standard for themselves.

Correction: An earlier version of this article misstated the scope of California’s waiver from federal air quality rules.