German automakers are frantically trying to save diesel.
Executives representing the country's top car brands -- Volkswagen (VLKAF), Audi, Porsche, BMW (BMWYY), Opel and Daimler (DDAIF) -- met with German government officials on Wednesday amid growing calls for cities to ban diesel cars over pollution concerns.
The carmakers agreed at the meeting to retrofit over 5 million vehicles with a software update that reduces nitrogen oxides emissions by as much as 30%, according to a statement issued by the German Association of the Automotive Industry.
The companies said they would cover the cost of the voluntary upgrade. They also said it would not hurt an engine's performance, fuel consumption or service life.
Environmental activists have been pressuring authorities to improve air quality by cracking down on diesel cars, which were at the center of a major emissions scandal that has roiled the industry.
A judge ruled last week that Stuttgart, the hometown of Mercedes-Benz and Porsche, may have to ban or severely limit diesel vehicles to bring down pollution and meet air quality standards. It could happen as soon as January 1.
Other German cities also face legal challenges to their clean air plans.
On one side of the issue are the angry voters, who are demanding tougher regulation and cleaner air. They are opposed by a mighty car industry that keeps the German economy humming.
With a national election looming in September, the government must carefully balance the competing interests.
A crucial industry
One in every five cars worldwide carries a German brand and the country's economy relies heavily on the industry.
Germany is home to 41 automobile assembly and engine production plants, and the sector employs over 800,000 people. That makes it a powerful voice in regional and national politics.
Industry sales totaled €404 billion ($477 billion) in 2016, according to the industry's association. Cars and auto parts accounted for roughly one fifth of all German exports (€260 billion or $308 billion).
Environmental concerns
Still, many Germans think more could be done to reduce pollution.
A study commissioned by the newspaper Die Welt showed that 73% of Germans think government policies toward the auto industry are too soft on the issue of air pollution.
Related: These countries want to ditch gas and diesel cars
Nearly half of all new cars sold in Western Europe still run on diesel, according to the European Automobile Manufacturers Association. But the technology is under increasing pressure.
Daimler said in July that it believes a ban on diesel cars is a bad idea because it would hurt the economy, trade and commuters.
"In our view there are other measures that could contribute more easily, effectively and faster to the reduction of particulate matter and nitrogen oxides," the company said in a statement.
Britain, France, Norway and India all want to completely ditch gas and diesel cars in favor of cleaner vehicles. At least 10 other countries, including Germany, China and Japan, have electric car sales targets in place.
Industry problems
The industry is still trying to turn the page on its diesel scandal.
Volkswagen (VLKAF) admitted in 2015 that it had been cheating on diesel emissions tests after its vehicles in the U.S. were found to be emitting up to 40 times the legal limit on nitrogen oxide.
Other automakers including Daimler (DDAIF), Fiat Chrysler (FCAU) and Renault (RNLSY) are also facing probes over diesel emissions.
More trouble could be on the horizon.
In July, European antitrust confirmed they were looking into claims that Germany's major carmakers may have been operating a cartel since the 1990s, colluding on everything from vehicle development to diesel emissions systems.
-- Nadine Schmidt and Chris Burns contributed reporting.