BP will pay $18.7 billion to settle all civil claims stemming from the 2010 Gulf of Mexico spill under an agreement with the Justice Department and state and local governments that were affected by the largest oil spill in United States history.

"[A]fter productive discussions with BP over the previous several weeks, we have reached an agreement in principle that would justly and comprehensively address outstanding federal and state claims, including Clean Water Act civil penalties and natural resource damages," Attorney General Loretta Lynch said Thursday in a statement. "BP is also resolving significant economic claims with the impacted state and local governments."

The agreement will be worked into a consent decree that must be approved by a federal court. The British oil giant already has spent more than $40 billion in legal fees and civil and criminal penalties from the Deepwater Horizon incident, in which 11 workers were killed and 4 million barrels of oil spilled into the Gulf.

For BP, the settlement reflects a desire to move on from a lengthy litigation process.

Read more on WashingtonExaminer.com