Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

HOUSTON — A federal judge ruled on Wednesday that ExxonMobil Corp should pay a $19.95 million penalty for pollution from its Baytown, Texas, refining and chemical plant complex between 2005 and 2013.

U.S. District Court Judge David Hittner issued the ruling in a citizen lawsuit brought under the U.S. Clean Air Act by two environmental groups, Environment Texas and the Sierra Club.

An Exxon sign shown at a station in this September 20, 2008 in Manassas, Virginia. Karen Bleier / AFP - Getty Images

Environment Texas welcomed the decision in the long-running suit, which was first filed in 2010.

"We think it might be the largest citizen suit penalty in U.S. history," said Luke Metzger, director of Environment Texas. "It definitely means it pays not to pollute."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Exxon said it would consider its legal options and may appeal the ruling.

"We think it might be the largest citizen suit penalty in U.S. history. It definitely means it pays not to pollute."

"We disagree with the court's decision and the award of any penalty," Exxon spokesman Todd Spitler said in an emailed statement. "As the court expressed in its decision, ExxonMobil's full compliance history and good faith efforts to comply weigh against assessing any penalty."

The suit was filed under a provision of the Clean Air Act that allows citizens to sue when regulators have failed to stop pollution. The two groups had contended the penalty could run as high as $573 million, but had only sought $41 million.

In a 101-page decision, Hittner ruled there had been 16,386 days of violations and 10 million pounds (4.5 million kg) of pollutants had been released in violation of operating permits issued to Exxon for the Baytown complex.

"The court finds given the number of days of violations and the quantitative amount of emissions released as a result, the seriousness factor weighs in favor of the assessment of a penalty," he wrote.

The decision comes about a year after the Fifth U.S. Circuit Court of Appeals determined Hittner had errored in a 2014 ruling assessing Exxon's liability for pollution from the refinery, chemical plant and olefins plant in the Baytown complex in the eastern suburbs of Houston.

Related: Meet the Four Republican Lawmakers Who Want to Abolish the EPA

The Fifth Circuit Court sent the case back to Hittner to reassess Exxon's liability.

The Baytown complex, which includes the second largest refinery in the United States, is regulated by the Texas Commission on Environmental Quality (TCEQ), which had fined Exxon $1.4 million for pollution. Hittner deducted that amount in determining the penalty.

The penalty will be paid to the federal government. Hittner said Exxon was liable for legal fees incurred by the two environmental groups.