LONDON (AFP) - BPs vilified chief executive Tony Hayward resigned Tuesday as the British oil giant revealed the Gulf of Mexico disaster will cost over 32 billion dollars after causing a record quarterly loss. Hayward, whose PR gaffes handling the oil spill made him a target of US fury, will be succeeded by Bob Dudley, who is currently in charge of BPs Gulf clean-up operations and will become the groups first US chief executive. BP said it had made a record 16.9-billion-dollar loss in the second quarter and that it will sell 30 billion dollars of assets over the next 18 months as it seeks to streamline operations and return to profitability. The troubled firm was pushed into the red by the 32.2 billion dollars (24.7 billion euros) set aside to pay for the costs of the spill the worst environmental disaster in US history. The Gulf of Mexico explosion was a terrible tragedy for which as the man in charge of BP when it happened I will always feel a deep responsibility, regardless of where blame is ultimately found to lie, Hayward said. BP and Hayward in particular have been mauled by Washington since the Deepwater Horizon rig exploded on April 20, killing 11 workers and unleashing millions of gallons of crude into the sea and onto the US Gulf coast. BP today announced that, by mutual agreement with the BP board, Tony Hayward is to step down as group chief executive with effect from October 1, it said, adding he will be nominated as a non-executive director of TNK-BP, a Russian joint venture. BPs share price has plunged about 40 percent since the explosion wiping tens of billions of dollars off the groups market value. BP shares rose 0.49 percent in value to 419 pence in Tuesday trade. As expected, BP reported the worst figures in UK corporate history, said ETX Capital trader Manoj Ladwa. Despite the company going through significant management and structural change, the future still remains uncertain for the oil giant and BP in a years time could be significantly different from the company today. The spill has been a public relations disaster for BP, with Hayward making a long line of gaffes since the Deepwater Horizon sank. Hayward added: From day one, I decided that I would personally lead BPs efforts to stem the leak and contain the damage, a logistical operation unprecedented in scale and cost. We have now capped the oil flow and we are doing everything within our power to clean up the spill and to make restitution to everyone with legitimate claims. I would like to thank all of the BP people involved in the response and the many thousands of others along the Gulf Coast who have joined us in our efforts. I believe the decision I have reached with the board to step down is consistent with the responsibility BP has shown throughout these terrible events. Under his contract, Hayward will receive one years salary, worth 1.045 million pounds (1.245 million euros, 1.620 million dollars). He also has a pension pot totalling 11 million pounds. BP added that Dudley will move to London and hand over his present duties to Lamar McKay, chairman and president of BP America. In this change of roles, I particularly want the people of the Gulf Coast to know that my commitment to remediation and restitution in the region is not lessened, Dudley said in the statement. I gave a promise to make it right and I will keep that promise, he vowed, adding that he would aim to place BP back on the road to recovery. It has taken more than three months to stem the Gulf of Mexico oil flow. Up to four million barrels (170 million gallons) of crude has escaped into the sea. The catastrophe has destroyed vital tourism, fishing and oil industries in the five US Gulf coast states and left BP facing soaring clean-up and compensation costs. The tragedy of the Macondo well explosion and subsequent environmental damage has been a watershed incident, said BP Chairman Carl-Henric Svanberg. BP remains a strong business with fine assets, excellent people and a vital role to play in meeting the worlds energy needs. But it will be a different company going forward, requiring fresh leadership supported by robust governance and a very engaged board. Hayward, 53, had already handed over day-to-day management of the crisis in June to Dudley, as criticism mounted. Hayward enraged Gulf residents when he said in a May 18 interview that the environmental impact of the spill would be very, very modest. Then on May 30 he was seen as insensitive to the families of the dead rig workers when he said he wanted the disaster over with so he could have his life back. BP finally capped the spill on July 15.