Oil giant BP said it had reached an 18.7bn US dollar (£12bn) legal settlement in the US to cover the Deepwater Horizon explosion and oil spill that killed 11 workers five years ago.
It said the agreement would settle all US federal, state and local claims for the Gulf of Mexico disaster, with payments spread over 18 years.
The agreement is with federal authorities as well as the states of Alabama, Florida, Louisiana, Mississippi and Texas. It also covers over 400 local government bodies.
BP chairman Carl-Henric Svanberg said: "Five years ago we committed to restore the Gulf economy and environment and we have worked ever since to deliver on that promise.
"We have made significant progress, and with this agreement we provide a path to closure for BP and the Gulf.
"It resolves the company's largest remaining legal exposures, provides clarity on costs and creates certainty of payment for all parties involved."
BP said this agreement would add around 10 billion dollars (£6.4bn) to the 43.8bn dollars (£28.1bn) of charges BP had already set against the disaster.
BP said the rough breakdown of the new agreement will see it pay 5.5bn dollars (£3.5bn) to the US Government under the Clean Water Act over the next 15 years.
It will pay 7.1bn dollars (£4.5bn) to the five Gulf states over the next 15 years to cover natural resource damages.
The oil explorer will pay a further 4.9bn dollars (£3.1bn) to the five Gulf states to settle economic and other claims.
Finally, BP will pay up to 1bn dollars (£640m) to resolve claims made by more than 400 local government bodies. It said the first of these payments is due to begin in around 12 months.
BP chief executive Bob Dudley said: "This is a realistic outcome which provides clarity and certainty for all parties.
"For BP, this agreement will resolve the largest liabilities remaining from the tragic accident and enable BP to focus on safely delivering the energy the world needs.
"For the United States and the Gulf in particular, this agreement will deliver a significant income stream over many years for further restoration of natural resources and for losses related to the spill."