BHP Billiton reported its biggest-ever loss on Tuesday (16 August), as slumping commodity prices, a bad bet on shale and the costs related to the Samarco dam disaster in Brazil continued to take their toll on the company.

In the year to 30 June, the commodity giant posted a $6.4bn (£4.9bn) compared with a $1.9bn profit in the corresponding period a year ago.

When excluding $7.7bn worth of writedowns and charges, underlying profit tumbled 81% year-on-year to $1.2bn on the back of weak commodity prices. The figure was marginally better than the $1.1bn analysts expected but it marked the smallest underlying profit the company has reported since it was created in 2001, when BHP and Billiton were merged together.

The FTSE 100-listed group said that during 2016 production was lower year-on-year in all commodity groups, with the exception of coking coal where output grew 1%.

BHP and its sector peers have struggled to deal with the slump in commodity prices over the last 12 months, which has seen average iron ore prices decline 28% year-on-year, while prices for copper and West Texas Intermediate crude oil fell 24% and 36% respectively over a 12-month period.

In January, BHP announced its biggest-ever write-down, as it wrote down the value of its shale assets in the US by $7.2bn on a pre-tax basis, on the back of the ongoing slump in global commodity prices.

The group added the commodity markets were likely to remain under pressure in the immediate future, although the longer-term outlook was more promising.

"While commodity prices are expected to remain low and volatile in the short to medium term, we are confident in the long-term outlook for our commodities, particularly oil and copper," said chief executive Andrew Mackenzie.

Writedowns related to the Samarco dam disaster, which killed 19 people in November 2015, were among the biggest contributors to the loss. In March, BHP said its Samarco joint venture has reached an agreement with Brazilian authorities for the restoration of the environment and communities affected by the disaster.

Samarco will pay R$2bn (£362m, $510m) this year, R$1.2bn in 2017 and another R$1.2bn in the following 12 months, with annual payments of between R$800m and R$1.6bn to be paid each year between 2019 and 2021, depending on project needs.