Since 2000 or so, China — along with, to a lesser extent, India and other developing nations — has been on a coal binge, building coal-fired power plants at a breakneck pace. Coal is what powered the country’s ludicrous, double-digit growth rates and lifted millions of rural Chinese out of poverty.

And coal power, more than any other single factor, is what has driven the steady rise in global carbon emissions. If the coal binge continues, global climate targets will almost certainly be out of reach, and much of the good done by coal will be undone by the ravages of climate change.

Happily, there are unmistakable signs that the binge is winding down.

As the annual BP Statistical Review of World Energy reveals, global demand for coal has fallen for the second year in a row. This graph shows why:

Coal consumption is falling in the US and some European countries — the UK grid recently experienced its first entirely coal-free day since the Industrial Revolution — but the big story is that China’s coal demand has turned the corner. It’s been falling for three years now and the government shows every sign of wanting to support and accelerate the trend.

A close-up view of coal’s global decline was offered earlier this year by researchers from Coalswarm, the Sierra Club, and Greenpeace. Drawing on the Global Coal Plant Tracker, they released their annual “Boom and Bust” report on the global coal pipeline.

Brad Plumer wrote about the same report last year, and it was mostly bad news. But a great deal changed in 2016. Though the big picture remains daunting, the shift from last year to this year is fairly astonishing and offers a ray of hope.

The coal renaissance is slowing

Here’s what happened with coal plants around the world, year on year, from 2016 to 2017.

Pre-construction activity (planning, permitting, etc.) was down a whopping 48 percent. In January 2016, there was 1,090 GW worth of coal capacity in pre-construction planning; as of January 2017, it had fallen to 570 GW.

Work in ongoing coal plant construction projects was down 19 percent. In China and India alone, scattered across more than 100 sites, some 68 GW worth of coal plant construction was frozen in place. In fact, across the world, “more construction is now frozen than entered construction in the past year,” per the report.

Construction starts — new coal plants entering construction — were down by 62 percent. Meanwhile, especially in the US and Europe, coal plants are retiring, to the tune of about 64 GW worth in the past two years.

It’s all slowing down.

The Chinese and Indian governments are reining in coal

For reasons Plumer has documented (chief among them horrendous air pollution), the Chinese government has made a concerted decision to slow coal’s roll.

This has involved a range of new restrictions on coal, to which 2016 added some notable contributions:

March 2016: Suspension of new plant approvals in 13 provinces and regions; a halt on construction starts in 15 provinces and regions. Implementation of a “traffic light system” halting new permitting and construction in 26 provinces and regions. Exceptions for projects in poor areas and old revolutionary base areas.

April 2016: Plans to retire outdated coal power plants.

September 2016: Cancellation of 15 specific coal projects.

October 2016: Halting “provincial self-use” plants and scaling down “sending-out” plants connected to coal power bases in several regions. Exceptions for residential district heating and coal base areas.

November 2016: Announcement of China’s 13th Five-Year Plan, with a coal power capacity cap of 1,100 GW.

January 2017: Cancellation of planning and construction of 85 specific plants in 13 provinces, and “scale control” limits on the amount that can be exported from particular power base areas.

None of these policies are written in stone, and all face implementation challenges, but cumulatively, the restrictions are having an effect. Coal power production peaked in China in 2013 (whether temporarily or permanently remains to be seen). And the number of new coal plants approved in China fell by 85 percent last year.

There is good reason to believe that China already has more coal capacity than it needs — capacity factors for coal plants in the country (the amount of time they spend running) dipped below 50 percent in 2015 and continued falling in 2016 — so all things being equal, these trends should continue. (With the caveat that all things are never equal in China.)

Meanwhile, India is still recovering from its coal bender. Coal capacity tripled between 2007 and 2017, from 71,121 MW to 211,562 MW. Demand hasn’t kept up, so capacity factors are low and the economics of coal plants suck. The Indian government’s December 2016 draft National Energy Plan says that “no further coal power capacity beyond that currently under construction will be needed until at least 2027.”

The government wants to install 215 GW of renewable energy by 2025, and renewables are getting cheaper and cheaper, so there’s real doubt that more coal will be needed even then. The trajectory is in the right direction.

The coal fight is now shifting to the rest of the developing world

Countries outside of China and India are responsible for just 29 percent of current global coal plant construction, but they account for 54 percent of the pre-construction activity. The center of gravity for coal seems to be shifting to countries like Turkey, Indonesia, and Vietnam. Governments in those countries have committed to large coal expansions, but they face headwinds in the form of local opposition and the falling cost of renewables.

Almost alone among OECD countries (save the aforementioned Turkey), Japan is also planning a bit of a coal binge: “the country has only built 1,950 MW of coal in the past five years, [but] 4,256 MW is currently under construction and 17,343 MW is in pre-construction planning.” This is in part a response to the shutdown of Japan’s nuclear fleet in the wake of the Fukushima accident.

Japan has made commitments under the Paris climate treaty, though, so there will be countervailing pressures as well. Coal-wise, it’s one of the key stories to watch.

There are other countries embracing coal as well — the report gets into detail on the top 10 or so. Here’s the full list of the top 30.

There’s a sliver of climate hope

If coal kept up the pace of growth of the past decade for the next 10 years, there would be virtually no chance at all of hitting our collective climate targets — the target agreed upon in Cancun (2 degrees Celsius above preindustrial levels) or the shared aspiration agreed upon in Paris (“well below” 2 degrees, ideally 1.5).

If coal continues its downward trajectory, the targets may still be within reach. Barely.

Here’s the key graph:

The carbon budgets for coal are in blue. The red is cumulative emissions from existing coal plants. Orange is from plants currently under construction. And green is from proposed plants, assuming that 37 percent of them are built (roughly the average over the past few years).

To hit the 2C target, pretty much all coal plants in the pre-construction phase will have to be abandoned. All construction projects that are currently frozen will have to be abandoned. And a number of coal plants will have to be retired before their 40-year life spans. To hit 1.5C, a lot of plants will have to be retired early.

Here’s what a phaseout of coal capacity would have to look like to hit the respective targets:

To hit 2C, developed nations would have to zero out coal by 2040, China by 2050, and the rest of the developing world by 2060. Hitting 1.5C means moving all those deadlines up by a decade.

How realistic is this? Here’s what the report says:

For the Cancun [2C] scenario, the assumed rate of global retirements until 2027 would be 25 GW per year in the OECD, a level that is on par with the current trend ... and 15 GW per year in China, consistent with China’s announced goal of retiring 100 GW of current capacity ... the Cancun scenario through 2029 could be achieved without retiring plants younger than 40 years. After 2030, younger plants would need to be retired. Meeting the Paris schedule would require an immediate doubling of the current pace of retirements, a prospect that appears optimistic at best.

So if the current downturn in coal continues for 10 years or so and then steadily accelerates, 2C is still in reach. To hit 1.5C, we would have to jam the accelerator to the floor and leave it there. “Optimistic at best” is about right.

Still, good news is better than bad news. The developing world coal binge was on the verge of eliminating any remaining breathing room on climate change. If current trends continue — a big if, for a million reasons — there still might just be some hope.