The settlement includes a record-breaking $1.256bn criminal fine against the company as well as an agreement by BP to plead guilty on several counts at next year's trial.
This overshadows the previous highest corporate criminal penalty of $1.2bn, imposed on pharmaceutical giant Pfizer in 2009.
BP said it would plead guilty to 11 offences relating to the workers' deaths plus another related to obstruction of Congress and two misdemeanors. The grand jury has also indicted two BP employees on 23 criminal counts in connection to the disaster.
The two highest-ranking BP supervisors aboard the rig will face a range of manslaughter and other charges, while a former senior BP executive was also charged with misleading Congress about the spill.
The April 2010 explosion on the Deepwater Horizon rig in the Gulf of Mexico killed 11 workers and sparked a major environmental catastrophe as the mile-deep Macondo prospect 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 settlement does not rule out future civil claims by workers or bereaved relatives, which US Attorney General Eric Holder said could still be resolved out of court. However, BP still faces economic and environmental damage claims sought by four Gulf Coast states and other private plaintiffs.
Mr Holder said yesterday's settlement "stands as a testament to the hard work of countless investigators, attorneys, support staff members, and other personnel".
BP said the payments would be spread over six years, adding it expected to be able to handle the payments "within BP's current financial framework".
The news saw US shares in BP gain by around 0.35%, though its London-traded shares remained flat.
Wall Street appeared encouraged that the plea deal could resolve a significant share of the liability BP faces.
Bob Dudley, chief executive of BP, said: "We apologise for our role in the accident and, as today's resolution with the US Government further reflects, we have accepted responsibility for our actions."
Pavel Molchanov, an oil company analyst with Raymond James, said: "It certainly is an encouraging step. 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 details at a presentation next month.
Jason Gammel, energy analyst at Macquarie in London, said: "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."
The disaster has dragged BP from second to fourth in the ranking of top Western oil companies by value.