The settlement includes a $US1.256 billion criminal fine, the largest such levy in US history, the oil company says. Wall Street analysts said the deal would allow BP to focus again on oil production.
One US senator from Louisiana said he hoped the settlement would not prevent his state and others for collecting civil penalties. An environmental group said BP should ultimately pay billions more.
The April 2010 explosion on the Deepwater Horizon rig in the Gulf of Mexico killed 11 workers. The mile-deep Macondo oil well then spewed 4.9 million barrels of oil into the Gulf over 87 days, fouling shorelines from Texas to Florida and eclipsing in severity the 1989 Exxon Valdez spill in Alaska.
The company said it would plead guilty to 11 felony counts related to the workers' deaths, a felony related to obstruction of Congress and two misdemeanors.
BP, which replaced its chief executive after the spill as its market value plummeted, still faces economic and environmental damage claims sought by four Gulf Coast states and other private plaintiffs.
Its US shares gained about 0.3 percent on Thursday while its London-traded shares were flat.
Wall Street analysts were encouraged that the plea deal could resolve a significant share of the liability BP faces. But it is not a "global" deal to resolve all outstanding liability.
"It certainly is an encouraging step," said Pavel Molchanov, oil company analyst with Raymond James. "By eliminating the overhang of the criminal litigation, it is another step in clearing up BP's legal framework as it relates to Macondo."
Analysts said they hoped to receive more detail at a presentation next month.
"Of course you never like to see value moving out of the company, but it's good news if this will allow them to be an oil company again," said Jason Gammel, energy analyst at Macquarie in London.
The disaster has dragged BP from second to a distant fourth in the ranking of top Western oil companies by value.
PROBATION AND MONITORS
A week after the US presidential election, the settlement could also prompt a debate in Congress about how funds would be shared with the Gulf Coast states.
Congress passed a law last year that would earmark 80 percent of BP penalties paid under the Clean Water Act to Louisiana, Mississippi, Alabama, Florida and Texas.
"With these unprecedented criminal penalties assessed, I urge the Obama administration to be equally aggressive in securing civil monies that can help save our Louisiana coast" through other avenues, Louisiana Senator David Vitter said in a statement. "I certainly hope they didn't trade any of those monies away just to nail this criminal scalp to the wall."
Larry Schweiger, president of the National Wildlife Federation called the settlement a "good down payment" on what BP should ultimately pay, which the environmental group argues is tens of billions of dollars more.
BP said the payments would be spread out over six years in total, adding it expected to be able to handle the payments "within BP's current financial framework".
The company has sold $35 billion worth of assets to fund the costs of the spill. Matching that, it has paid $23 billion already in clean-up costs and claims, and has a further $12 billion earmarked for payment in its spill trust fund.
The deal also includes a settlement with the US Securities and Exchange Commission, plus payments to the National Fish & Wildlife Foundation and the National Academy of Sciences.
In addition to the penalties, BP agreed to go on five years' probation and to the appointment of two monitors, one for process safety and one for ethics. They have four-year terms.
The oil company said it has not been advised of any government authority that intends to debar BP from federal contracting activities as a result of the deal.
In an August filing, the Justice Department said "reckless management" of the Macondo well "constituted gross negligence and willful misconduct" which it intended to prove at a civil trial set to begin in New Orleans in February 2013.
Negligence is a key issue. A gross negligence finding could nearly quadruple civil damages owed by BP under the Clean Water Act to $21 billion in a straight-line calculation.
Chief Financial Officer Brian Gilvary said the company's provisions should be enough to cover liabilities, provided it avoids a conviction for gross negligence, and that it had shareholder support to fight the case should that happen.
"I can boldly defend where we are in the provisions today. If something were to happen in the trial that read across to gross negligence ... then we would certainly take that to appeal," he said on a conference call with analysts.
Still unresolved is potential liability faced by Swiss-based Transocean Ltd, owner of the Deepwater Horizon vessel, and Halliburton Co, which provided cementing work on the well that US investigators say was flawed.
Halliburton said it "remains confident that all the work it performed with respect to the Macondo well was completed in accordance with BP's specifications for its well construction plan and instructions. Halliburton has cooperated with the DOJ's investigation." Transocean was not available to comment.
According to the Justice Department, errors made by BP and Transocean in deciphering a pressure test of the Macondo well are a clear indication of gross negligence.
"That such a simple, yet fundamental and safety-critical test could have been so stunningly, blindingly botched in so many ways, by so many people, demonstrates gross negligence," the government said in its August filing.
Transocean disclosed in September that it is in discussions with the Justice Department to pay $1.5 billion to resolve civil and criminal claims.
BP has already announced an uncapped class-action settlement with private plaintiffs that the company estimates will cost $7.8 billion to resolve litigation brought by over 100,000 individuals and businesses claiming economic and medical damages from the spill.