Image caption BP has changed its chief executive since the oil spill

Oil giant BP has announced a return to profit in the three months to September after last quarter's record loss.

The firm said its replacement cost profit for the period was $1.85bn (£1.15bn), as against the $17bn loss recorded from April to June.

The previous loss reflected the massive costs of the Gulf of Mexico oil spill crisis, which followed an explosion on a drilling rig in April.

BP said the cost of the oil spill had now risen by $7.7bn to $39.9bn.

Bob Dudley, who led the clean-up, became BP's chief executive last month.

He replaced Tony Hayward, who was criticised for his leadership during the crisis.

BP said the $39.9bn cost of the oil spill included $20bn set aside under pressure from the US government for compensation payments.

Eleven workers on the Deepwater Horizon drilling rig were killed by the explosion on 20 April and hundreds of miles of coast were polluted.

The well was finally capped on 15 July, after an estimated 4.9m barrels of oil (171m gallons) had leaked into the sea, and fully sealed in September.

'Safety first'

BP's $1.85bn third-quarter profit compares with a $5bn profit for the same period in 2009.

Analysis BP's return to the black shows quite how strong and profitable it is. BP has taken a further $7.7bn (£4.8bn) of charges relating to the Gulf of Mexico oil spill - bringing to almost $40bn the total provision that it has made for the ultimate costs of the debacle. BP has benefited from a higher oil price, which boosted earnings in its giant exploration and production division by more than $2bn, offsetting a fall in the amount of oil produced. That division is being broken up, as part of comprehensive efforts by the new chief executive Bob Dudley to rehabilitate this battered business. His cure also includes shrinking BP, selling off up to $30bn of assets by the end of the year, to cover those huge oil spill costs. BP and Lloyds: We all pay for their recovery

The news was well received by the markets, which sent the company's share price up more than 1% by early afternoon.

"The update provides a stark reminder that the fallout from the spill will follow BP for some considerable time to come," said Richard Hunter, head of UK equities at Hargreaves Lansdown stockbrokers.

"In the meantime, BP has refocused itself with safety as a priority and, in terms of its normal operations, the company continues to generate enormous amounts of income."

In another development, Japanese firm Mitsui said on Tuesday that one of its subsidiaries, Moex Offshore, had been billed $1.9bn by BP to cover costs from the oil spill.

Moex owns 10% of the Macondo oil well project operated by BP.

Mitsui said it had withheld payment, because it said there was uncertainty about the amount due.

Last week, US investigators said cement used to seal the Macondo well may have contributed to the blow-out that caused the Gulf of Mexico oil spill.

Both BP, which owned the well, and Halliburton, the contractor responsible for the cement, were aware of tests showing it was unstable, they said.

Halliburton has denied the claims, saying the tests were invalid as they were on a different kind of cement.