The past two years have been a tough time to be a mining sector executive. Excess capacity and the oversupply of the market have sent the price of the main commodities plunging and miners have struggled to keep up with the rapidly changing market.

However, the sector is finally starting to change. China is taking action to curb the excess supply of commodities, bringing some stability back to prices. Indeed, as Chinese policymakers have moved to close some of the countries more inefficient coal mines, the price of coking coal has jumped by more than 100% this year. Meanwhile, actions to rein in the oversupply and increased demand for iron ore have sent its price up to $60 per tonne in recent weeks, from the 10-year low of $37 a tonne reported at the end of last year.

Finally, the coal and iron ore markets are rebalancing, which is great news for the likes of BHP Billiton (LSE: BLT) and Rio Tinto (LSE: RIO). Rio is the world’s largest iron ore producer and also mines coal, while iron ore and coal make up two of BHP’s four primary mined commodities.

Attracting attention 

City analysts are already beginning to acknowledge Rio and BHP’s improving outlook. 

Last week analysts at RBC Capital Markets raised their rating on Rio to sector perform with a price target of 3,400p, up a staggering 54% from the previous price target of 2,200p. RBC’s analysts believe that the company has the most attractive valuation in the mining sector with the best-in-class growth. In other words, Rio is cheap, and earnings are expected to grow rapidly going forward. 

According to the City consensus, Rio is on track to report earnings per share of 150p this year, which implies a forward P/E ratio of 15.9. The shares currently support a dividend yield of 3.7%.

BHP’s first-half results may have disappointed on a headline basis, but on an underlying basis, the company is making steady progress. 

Hefty loss but steady progress 

BHP reported a net loss of $6.4bn for the six months to the end of June, down from a profit of $1.9bn a year earlier. Exceptional items were to blame for the significant loss. They totalled $7.7bn. On an underlying basis though, BHP smashed expectations reporting earnings of $1.2bn, ahead of consensus forecasts of $1.1bn. This sudden improvement in underlying earnings meant City analysts had to rush to update their earnings estimates for the company next year. 

For the year ending June 30 2017, analysts now expect the company to report a pre-tax profit of £3.6bn and earnings per share of 38.2p, up 122% on reported underlying earnings per share for last year. Based on these forecasts the company’s shares are currently trading at a forward P/E of 24.7 and support a dividend yield of 2.5%.

So overall, things are finally starting to look up for Rio and BHP. Their recovery is only just getting started, but the shares might be attractive for long-term investors.

Looking for dividends?

If you're looking for dividend champions to jump-start your portfolio's income, I strongly recommend you check out this special report, which gives a rundown of what I believe is one of the hottest dividend stocks in London today.  

The exclusive report entitled A Top Income Share looks at a hidden FTSE giant that's already an income champion but is also investing for growth and these ambitious expansion plans should power dividends through the roof in the years ahead.

To discover more just click here and enjoy this exclusive wealth report. It's 100% free and comes with no obligation.

Rupert Hargreaves has no position in any shares mentioned. The Motley Fool UK has recommended Rio Tinto. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors.