The deal, once approved by a judge, would resolve all civil claims against BP and end five years of legal fighting over the 134 million-gallon (500 million liter) spill.
It also would bind the company to a massive cleanup project in the Gulf Coast area aimed at restoring wildlife, habitat and water quality.
"BP is receiving the punishment it deserves, while also providing critical compensation for the injuries that it caused to the environment and the economy of the Gulf region," Attorney General Loretta Lynch said at a Justice Department news conference.
"The steep penalty should inspire BP and its peers to take every measure necessary to ensure that nothing like this can ever happen again," Lynch said.
The settlement, filed in federal court in New Orleans, finalizes an agreement first announced in July. The next steps are a 60-day public comment period and court approval.
In a statement, BP spokesman Geoff Morrell said the settlement total announced Monday includes amounts previously spent or disclosed by the company, and "resolves the largest litigation liabilities remaining from the tragic accident."
Among other requirements, BP would have to pay $5.5 billion in Clean Water Act penalties and nearly $5 billion to five Gulf states: Alabama, Florida, Louisiana, Mississippi and Texas.
It would require the company to pay $8.1 billion in natural resource damages, with funds going toward Gulf restoration projects such as support for coastal wetland and fish and birds.
An additional $600 million would cover other costs, such as federal and state reimbursement claims, with up to $1 billion to local governments to settle claims for economic damage from the spill.
The spill followed the April 2010 explosion on an offshore rig that killed 11 workers. BP earlier settled with people and businesses harmed by the spill, a deal that's so far resulted in $5.84 billion in payouts.
A report by Deepwater Horizon Natural Resource Trustees called the oil spill damages "unprecedented." It found that deep ocean water currents carried oil from the spill hundreds of miles from the blown-out well.
Oil from the spill was deposited onto at least 400 square miles of the sea floor and washed up onto more than 1,300 miles of shoreline from Texas to Florida. The oil was toxic to fish, birds, plankton, turtles and mammals, causing death and disease and making it difficult for animals to reproduce.
Environmental Protection Agency Administrator Gina McCarthy said that besides the toll on human life, "the spill drove Gulf communities into a period of painful uncertainty, forcing questions that no American family should ever have to ask: Is my food safe to eat? Is it dangerous for my kids to play near the shore? Is the air still clean to breathe? And will my businesses ever recover?"