The commodities sector has been hit by escalating trade tensions between Washington and Beijing, but coal is bucking that trend as China's demand for the fossil fuel remains high.

Benchmark Australian thermal coal prices have risen 40 percent this year so far, breaking through $120 per metric ton for the first time since 2012.

“We think the jump in the coal price has been a response to an unusually hot summer in China and solid economic growth in the first half of the year,” said Caroline Bain, chief commodities economist at consultancy, Capital Economics.

A hotter-than-usual summer drives up demand for air-conditioning.

The heatwave also dried up water reservoirs, hitting hydroelectricity power output. Hydro power is a major source of renewable energy in China.

Contributing to the supply crunch is a broad decline in domestic coal production in recent years due to the China's attempts to clean up its environment.

All those factors contribute to greater demand for coal imports.

China's key coal supplier is Australia, but the U.S. also exports the fuel source to Asia's largest economy.

American coal exports to China doubled from 2016 to 2017, but the fossil fuel is set to be subject to a 25 percent tariff beginning at an unspecified date.

Coal's strength contrasts with declines of more than 8 percent in the S&P GSCI industrial metals and agriculture indexes that were due to a combination of fears of a global trade war and a softer Chinese economy, Bain noted.

Environmentalists are campaigning to end the use of coal — generally dirtier than other fuel sources such as natural gas — but demand for the commodity has held out so far. That's even been true in China, where the government is rushing to clean up politically sensitive air pollution.

Energy giant BP said in its benchmark annual Statistical Review of World Energy that the share of coal used in power generation is 38 percent — practically unchanged from 1997.

In China, capacity for renewable energy and cleaner fuel like natural gas has not caught up with demand growth, particularly when alternatives like hydropower plants have to wind down output due to weather conditions. Natural gas infrastructure is also not ready in some regions even when supply of the fuel is available.

J.P. Morgan said in a recent note that growth in China's power generation was up 8 percent from January to April — more than double its forecast of just 3 percent. The growth was due to an increase for thermal power, the bank added.

Other than China, demand from Japan and emerging regions in Southeast Asia has also supported coal prices. That's come as supplies have tightened due to fervent campaigning from environmentalists that has dried up funding and investment in the sector.