Troubled oil group BP has taken a £$32.2bn charge in respect of the Gulf of Mexico oil spill, including the $20bn it has already committed to putting in escrow.As a result the company reported a headline replacement cost pre-tax loss of $16.97bn for the second quarter, compared to a profit of $3.14bn the year before. It is the biggest ever quarterly loss in UK corporate history.After adjusting for all non-operating items and fair value accounting effects, second-quarter underlying replacement cost profit was $5bn, in line with market expectations, compared to $2.9bn in the second quarter of 2009.The size of the provision to cover the fall-out from the oil spill exceeded most estimates which ranged from $25bn to $30bn.The $32.2bn charge includes cost to date of $2.9bn for the response and a charge of $29.3bn for future costs, including the funding of the $20bn escrow fund."We expect we will pay the substantial majority of the remaining direct spill response costs by the end of the year. Other costs are likely to be spread over a number of years, including any fines and penalties, longer-term remediation, compensation and litigation costs," said Chief executive officer Tony Hayward who, it was confirmed, will step down on October 1 to be replaced as boss by Bob Dudley.Hayward said that, leaving the Gulf of Mexico issue aside, the performance by the company was "very encouraging".Second-quarter operating cash flow, excluding Gulf of Mexico oil spill costs, was $8.9bn, up 31% compared with the same quarter last year.Net debt was reduced by $2.9bn in the first half to $23.2bn despite the money spent on the response to the Gulf of Mexico oil spill. The ratio of net debt to net debt plus equity was 21% compared with 22% a year ago.In addition, the company has lined up substantial additional bank borrowing facilities, all of which remain undrawn, has reduced cash outflow in 2010 by reducing capital expenditure and by cancelling the payment of further dividends this year, as previously announced.