British energy giant BP said on Monday it had recovered $4.0 billion in costs linked to last year's devastating Gulf of Mexico oil spill from US group Anadarko Petroleum Company.

Anadarko has also agreed to transfer to BP its 25 percent stake in the Macondo well, where a leak in 2010 sparked an environmental catastrophe on the US Gulf coast.

BP said in a statement that it had "reached agreement with Anadarko Petroleum Company to settle all claims between the companies related to the ... accident" on the BP-leased Deepwater Horizon rig.

BP shares rose 5.36 percent to 438.6 pence, topping London's FTSE 100 benchmark index in midday deals on Monday, a week before the group publishes third-quarter earnings. The FTSE 100 added 0.50 percent to 5,493.20 points.

Chief executive Bob Dudley said the "settlement represents a positive resolution of a significant uncertainty and it resolves the issues among all the leaseholders of the Macondo well.

"There is clear progress with parties stepping forward to meet their obligations and help fund the economic and environmental restoration of the Gulf.

"It's time for the contractors, including Transocean and Halliburton, to do the same," he added in the statement.

The US government last week slapped BP, Transocean -- the Swiss owner and operator of the drilling rig -- and US oil services group Halliburton with citations for violating oil industry regulations in what is expected to lead to massive fines for the deadly 2010 oil spill.

The decision to also cite BP's subcontractors could strengthen the British energy giant's legal case for recovering some of the multi-billion dollar costs of the spill from Halliburton and Transocean.

Halliburton designed and pumped the well's cement, found to be a key factor in the accident.

The Macondo leak was triggered by an explosion on the Deepwater Horizon rig in the Gulf of Mexico on April 20, 2010. The blast killed 11 workers, caused millions of barrels of oil to spew into the sea and left the British company scrambling to meet huge compensation costs.

BP said its agreement with Anadarko was "not an admission of liability by any party regarding the accident."

It added in the statement: "Under the settlement agreement, Anadarko will pay BP $4 billion (2.9 billion euros) in a single cash payment.

"BP will apply the payment to the $20 billion trust it established that is available to meet individual, business and government claims, as well as the cost of the natural resource damages.

"Anadarko will also transfer all of its 25 percent interest in the MC252 (Macondo) lease to BP."

In order to meet its own compensation costs and raise $30 billion by the end of 2011, BP is selling assets. The British group last week said it had so far paid out about $7.0 billion in compensation claims arising from the oil spill.