NEW ORLEANS (AP) – A federal judge on Tuesday approved an agreement for BP PLC to plead guilty to manslaughter and other charges and pay a record $4 billion in criminal penalties for the company’s role in the 2010 rig explosion and oil spill in the Gulf of Mexico.

U.S. District Judge Sarah Vance said the plea deal was “just punishment” considering the alternatives to the settlement, including the risk that a trial could result in a lower fine for BP.