A US court signed off on BP's civil settlement for $18.7bn (£13.2bn) relating to the Deepwater Horizon incident late last night.
BP has agreed to pay damages to the United States government as well as the Gulf States of Alabama, Florida, Louisiana, Mississippi, and Texas.
The payments have been staggered so some will be payable as late as 2031.
"The approval of this agreement will open a final, hopeful chapter in the six-year story of the Deepwater Horizon tragedy," said attorney general Loretta Lynch. "Today's action holds BP accountable with the largest environmental penalty of all time while launching one of the most extensive environmental restoration efforts ever undertaken."
A BP spokesperson said: "We are pleased that the court has entered the Consent Decree, finalising the historic settlement announced last July."
In 2010, the Deepwater Horizon rig exploded, killing 11 people and spilling gallons of oil into the Gulf of Mexico.
Shares in BP were trading down 2.4 per cent at 336.3p just after 12pm London time.