BP has agreed to pay out more than $20bn in compensation for the 2010 Deepwater Horizon oil spill in the Gulf of Mexico.

The Justice Department and five US states finalised the deal that will settle all civil claims against the British energy giant and ends five years of legal fighting over the nearly 134m-gallon spill.

As part of the agreement, announced by the US Department of Justice, as part of the settlement, BP must pay a $5.5bn penalty under the federal Clean Water Act, 80 per cent of which will go to restoration efforts in the Gulf of Mexico.

The Deepwater Horizon spill in 2010 claimed 11 lives and led to millions of barrels of oil polluting the sea. The total bill now stands at $53.8bn (Reuters)

Meanwhile, $8.1bn will go towards natural resource damages, including $1bn BP already committed to pay for early restoration. The money will go towards helping restore habitats used by marine mammals, fish, sea turtles and birds, the Associated Press said.

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.8bn in payouts.

“Building on prior actions against BP and its subsidiaries by the Department of Justice, this historic resolution is a strong and fitting response to the worst environmental disaster in American history,” said Attorney General Loretta Lynch.

“BP is receiving the punishment it deserves, while also providing critical compensation for the injuries it caused to the environment and the economy of the Gulf region."

Geoff Morrell, a spokesman for BP, said the announcement took the company another step towards finalising the settlement it had announced in the summer.