• Outgoing chief executive has £1m payoff and £10m pension pot • BP plunges into red after setting aside £20bn to meet costs of Gulf oil spill • Greenpeace protesters close 50 BP garages in London

BP today reported one of the largest losses in British corporate history because of the cost of the catastrophic oil spill in the Gulf of Mexico.

In its second-quarter results the company set aside $32.2bn (£20.7bn) to meet the cost of the clean-up, far higher than the City had expected and plunging the company into a $17bn loss. It made a profit of $3.1bn in the same quarter last year.

The dramatic loss means that BP will be able to slash its tax bill by about $10bn, although most of the pain will be felt by the US treasury.

To pay for the mounting costs of the spill created by the explosion on the Deepwater Horizon rig on 20 April, BP plans to sell $30bn worth of assets – predominantly oil and gas fields – over the next 18 months.

The company also confirmed well-trailed reports that Hayward will receive a £1m payoff and a pension expected to be worth about half a million pounds a year.

As expected he will be replaced by an American, Bob Dudley, a BP veteran who is currently overseeing the clean-up of the oil spill. Hayward will become a non-executive director of the firm's Russian joint venture TNK-BP.

In London, Greenpeace protesters closed almost 50 BP service stations. The environmental action group is calling on Hayward's successor to throw the weight of the company behind a push to create green and renewable sources of energy.

The company's second-quarter results showed the full scale of the clean-up effort in the Gulf.

Since oil first reached the shore, a total of 836 miles of Gulf coast in Louisiana, Mississippi, Alabama and Florida have been affected. There have been more than 6,390 vessels (including skimmers, tugs, barges and recovery ships) and over 11m feet of boom deployed offshore to reduce the amount of oil reaching the shoreline.

The operations have recovered approximately 825,000 barrels of oily liquid. In addition, a 409 controlled burns have been carried out, removing an estimated 261,400 barrels of oil from the surface of the sea. In total, more than 40,000 people are involved across five states of the US.

The results also set out the flurry of legal proceedings that the spill has created. BP is the subject of a US department of justice investigation to determine whether US civil or criminal laws have been violated; a US presidential commission to examine the causes of the incident; a joint investigation by the US coastguard and the Bureau of Ocean Energy Management, Regulation and Enforcement (which until June 2010 was named the Minerals Management Service); an inquiry by the Securities and Exchange Commission and other investigations by US state and federal agencies including the US Chemical Safety and Hazard Investigation Board as well as the US Congress.

In addition, BP group companies are among those named as defendants in more than 300 private civil lawsuits.