The Justice Department unveiled final details of a record-setting civil settlement with BP over the 2010 oil spill in the Gulf of Mexico, a deal the department said would ultimately cost the London-based oil giant $20.8 billion.

“The historic civil penalty also sends a clear message of accountability for those who pollute the U.S. environment,” said Adm. Paul Zukunft, the U.S. Coast Guard commandant.

The highlights of the settlement include $8.1 billion in natural resource damages, including $1 billion BP agreed to pay earlier; $5.5 billion plus interest for Clean Water Act penalties; and $5.9 billion under a separate agreement to cover state and local government claims.

In July, when the outlines of the deal were announced, BP put the cost of the settlement at $18.7 billion. Attorney General Loretta E. Lynch said the government was counting some coastline restoration money that BP did not. The settlement does not, however, include $4 billion that BP agreed to pay earlier to settle criminal charges or the billions more it has spent cleaning up the oil spill and settling separate civil claims with private individuals.

The Justice Department settlement includes $700 million to address natural resource problems that might come to light later. Zukunft said that oil most recently washed ashore in March, when a tar mat appeared. The type of oil from the mat matched the type that gushed from BP’s Macondo well.

The settlement ends a chapter of the BP oil spill, which occurred April 20, 2010, when a blowout on the Deepwater Horizon oil rig killed 11 workers, set the rig on fire and triggered the spill. It took 87 days to stop the oil from surging into the waters of the Gulf of Mexico.

The government said that the oil slick at one point grew to the size of Virginia and fouled 1,300 miles of coastline.

The Clean Water Act fine was by far the largest in history, amounting to $1,725 a barrel. That fell well short of the maximum allowable fine, $4,300 a barrel in cases of gross negligence, but Lynch said that it would have taken several years to pursue the higher figure and that the settlement now “would let us get the money to the gulf right away.”

Zukunft said that “tourism is back like never before,” adding that Florida, Alabama and Mississippi “had banner years.” But he said that the wetlands had not recovered and were vital to protect the coast and sustain fisheries.

Lynch said that the settlement “is not designed to discourage any valid economic activity” and said that oil production in the Gulf of Mexico is “a valid and valued part of the American economy.” But she added that the massive fines were designed to “let other companies know they are going to be responsible for the harm that occurs should accidents like this happen in the future.”