BP Plc chief executive Tony Hayward will step down as head of the oil giant on October 1 and be replaced by fellow executive Robert Dudley.

News of Hayward's departure came as the company announced on Tuesday it would take a charge as a result of the Gulf of Mexico oil spill amounting to $32.2 billion, driving BP to a second quarter loss of $16.97 billion.

The tragedy of the Macondo well explosion and subsequent environmental damage has been a watershed, chairman Carl-Henric Svanberg said, announcing Hayward's departure. BP remains a strong business ... but it will be a different company going forward.

BP said Dudley, currently head of BP's U.S. operations, would be based in London and hand over his present duties to Lamar McKay.

Hayward will receive a year's salary amounting to 1.045 million pounds ($1.6 million).

Excluding oil spill and other non-operating costs, BP's replacement cost profit was $4.98 billion, in line with the average forecast from a Reuters poll of 11 analysts.

Replacement cost profit strips out gains or losses related to changes in the value of fuel inventories and as such is comparable with net income under U.S. accounting rules.

In a third statement BP said it planned to sell assets worth up to $30 billion over the next 18 months and cut its net debt level down to between $10 billion and $15 billion over the next 18 months.

The company said it would consider its position on future dividend payments at the time of its fourth-quarter results.

(Reporting by Tom Bergin; writing by Paul Hoskins; editing by Myles Neligan)