Royal Dutch Shell has reported a deep financial loss after a record writedown on the value of its oil and gas assets due to the collapse in global market prices triggered by coronavirus.

The Anglo-Dutch oil giant revealed a net loss of $18.3bn (£14.1bn) for the second quarter of 2020, down sharply from a net profit of $3bn over the same period last year and $2.7bn in the first three months of 2020.

But the company was rescued from what was expected to be its worst set of quarterly financial results on record by its oil trading business, which helped shore up the company’s income as prices plunged to 21-year lows.

Shell reported an adjusted net income of $638m in the second quarter, down 82% from the same period a year earlier, after analysts predicted a $664m loss.

Ben van Beurden, Shell’s chief executive, said the company had delivered “resilient” cash flows in “a remarkably challenging environment”.

The company was still forced to make a record downgrade to the value of its oil and gas assets through a post-tax impairment charge of $16.8bn, after revising down its forecasts for global oil prices in the wake of the Covid-19 pandemic.

The writedown includes the group’s stake in an offshore oilfield in Nigeria, owned in partnership with Italian oil company Eni, which is at the centre of an ongoing corruption court case in Italy.

Shell expects global oil prices to remain well below average 2019 levels for the next three years. It has forecast oil prices to average $35 a barrel in 2020, rising to $40 in 2021, $50 in 2022 and $60 in 2023. The average oil price last year was $64.36 a barrel.

Falling oil price forecasts has also taken its toll on French oil company Total, which announced an $8bn writedown on the value of its assets, including $7bn from its Canadian oil sands.

Total reported a profit for the second quarter of $126m, down 96% from the same months last year, but has decided to keep its shareholder dividends in tact.

Earlier this year Shell slashed its shareholder dividend for the first time since the second world war and warned it is facing a “crisis of uncertainty” following the collapse of global oil prices.

Van Beurden said the “monumental” decision to cut the payout by 66%, from $15bn last year to $5bn this year, was difficult but necessary to preserve the financial resilience of the company.

Shell revealed in April that its profits for the first quarter tumbled to $2.9bn (£2.3bn), down 46% from $5.3bn in the same quarter last year, but that the second quarter would be worse.

The company said it would scrap all executive bonuses for this financial year, and cut its spending budgets and costs to save up to $9bn. Shell said it would “probably” consider voluntary redundancies later in the year.