BP will pay the largest corporate settlement in U.S. history – worth $20.8 billion – to resolve claims linked to the 2010 Deepwater Horizon oil spill in the Gulf of Mexico, Attorney General Loretta Lynch announced Monday.

Payments will be spread out over 16 years. The deal settles claims from five Gulf states: Alabama, Florida, Louisiana, Mississippi and Texas.

"BP is receiving the punishment it deserves," Lynch said, adding that the settlement would help pay for damage to the environment and the local economy.

It ends five years of legal fighting over the nearly 134 million-gallon oil spill, the worst offshore oil disaster in U.S. history. The spill followed the April 2010 oil rig explosion that killed 11 workers.

Among other requirements, BP will be forced to pay $5.5 billion in Clean Water Act penalties and nearly $5 billion to those Gulf states.

"The steep penalty should inspire BP and its peers to take every measure necessary to ensure that nothing like this can ever happen again," Lynch said.

There was no immediate response from BP. The oil giant earlier settled with people and businesses harmed by the spill, a deal that so far has resulted in $5.8 billion in payouts.

The Associated Press contributed to this report.