NEW ORLEANS (AP) -- A federal judge has approved Transocean's (NYSE:RIG) agreement with the Justice Department to plead guilty to a misdemeanor charge and pay $400 million in criminal penalties for its role in the 2010 Gulf of Mexico oil spill.

U.S. District Judge Jane Triche Milazzo accepted Transocean's plea and imposed the agreed-upon sentence during a hearing Thursday. The Swiss-based drilling company could have withdrawn from the deal if she had rejected it.

Transocean agreed last month to plead guilty to a misdemeanor charge of violating the Clean Water Act. The company also agreed to pay $1 billion in civil penalties. A different judge will decide whether to accept that part of the settlement.

Transocean owned the rig Deepwater Horizon, which exploded and sank over BP's (NYSE:BP) Macondo well. The accident killed 11 men.

The Motley Fool owns shares of Transocean. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.