Of the penalties, $4 billion will resolve criminal charges and an additional $525 million will be paid to resolve claims brought by the Securities and Exchange Commission.
"All of us at BP deeply regret the tragic loss of life caused by the Deepwater Horizon accident as well as the impact of the spill on the Gulf coast region," said Bob Dudley, BP's CEO, in a statement. "From the outset, we stepped up by responding to the spill, paying legitimate claims and funding restoration efforts in the Gulf."
"We apologize for our role in the accident, and as today's resolution with the U.S. government further reflects, we have accepted responsibility for our actions," Dudley added.
The fine comes on top of $20 billion that the company has agreed to pay into a trust fund to meet damage claims from the spill. It said it expects to pay a final $860 million into that fund this quarter.
BP reported a $17.2 billion loss in the quarter when the explosion took place. But it has been profitable since then, booking total profits of $43 billion over the course of the subsequent nine quarters.
In April 2010, the explosion on BP's Deepwater Horizon rig killed 11 workers and fouled the Louisiana coastline and other parts of the Gulf with millions of barrels of oil. Each death resulted in a felony charge to which the company will plead guilty.
In addition, the company will plead guilty to a count of obstruction of Congress. The charge is related to statements made to a member of Congress by two BP executives about flow rate estimates during the spill. The two individuals were not identified in the company's statement.
BP also will plead guilty to one misdemeanor count under the Clean Water Act and one misdemeanor count under the Migratory Bird Treaty.
Family members of the victims who spoke to CNN Thursday said they were pleased that BP was being forced to pay for the blast, but said it doesn't make up for their loss.
"It doesn't bring my boy back, but it does show everybody that they're guilty and everybody knows it," said Billy Anderson, whose son Jason was one of the rig workers killed.
Arlene Weise lost her 24-year-old son Adam on the rig that day.
"I knew all along that BP was the devil in that accident," she said. "Now they're getting their due."
But Weise said Thursday's announcement offered only a limited sense of justice.
"It doesn't matter how much money anyone pays," she said. "It doesn't nearly amount to what we've lost."
The well was capped three months after the explosion, but in that time, the spill caused extensive environmental damage to the Gulf. Embattled CEO Tony Hayward was forced to resign, and BP shares plummeted.
BP has reached a $7.8 billion settlement with lawyers representing private-sector victims. But in September of this year, the Justice Department accused BP of gross negligence and a "culture of corporate recklessness" in a federal court filing, which expanded the company's liability.
A major civil trial set to take place in New Orleans has been delayed until February 2013.
Transocean, the owner and operator of the rig, also has unresolved liability issues. The DOJ, in its September filing, said the company is also guilty of gross negligence.
"BP did not act alone, by any means, and its gross negligence and willful misconduct are inextricably joined with the acts and omissions of Transocean," the government said in the filing.
--CNNMoney's Mark Thompson, and CNN's David Ariosto contributed reporting to this article.
™ & © 2012 Cable News Network, Inc., a Time Warner Company. All rights reserved.