ExxonMobil is going to clean up the air in Texas and Louisiana.

A federal court ruled in April that Exxon violated the Clean Air Act by releasing 10 million pounds of pollutants at its Baytown, Texas facility. The Trump administration settled with Exxon on Tuesday.

As part of the agreement, Exxon will pay $300 million to resolve air pollution allegations at eight of its chemical plants. It will upgrade its pollution-control technology at five facilities in Texas and three in Baton Rouge, Louisiana, the Justice Department and Environmental Protection Agency announced.

Exxon also agreed to pay a $2.5 million civil penalty to the EPA.

"This settlement means cleaner air for communities across Texas and Louisiana, and reinforces the EPA's commitment to enforce the law and hold those who violate it accountable," EPA Administrator Scott Pruitt said.

Exxon said in a statement that the agreement will "help improve flare efficiency at these chemical facilities, which are among the largest petrochemical complexes in the world."

One climate change group said the deal amounted to a "slap on the wrist."

"These mild fines are tiny compared to the colossal wealth of fossil fuel elites, and will only embolden Exxon," said Lindsay Meiman of environmental activist organization 350.org.

Exxon has been battling charges in recent months that it downplayed the threat of global warming.

In August, a Harvard study concluded Exxon "misled the public" on climate change for nearly four decades. Last month, San Francisco and Oakland filed lawsuits demanding that Exxon and top oil companies pay billions to cover damages from climate change.

Exxon (XOM) did not directly address climate change criticism, but the company said it "complies with environmental laws, regulations and permits."