President Donald Trump may have little interest in climate change. But in China, the government, and increasingly the public, see it as a real danger.

Climate change is considered responsible for rising sea levels that threaten coastal cities as well as for aggravating droughts in the north, floods in the south and, as it now turns out, the omnipresent smog.

Some people wonder whether Trump’s indifference might reduce China’s willingness to take action against climate change. Why bother if the second-biggest emitter of greenhouse gases appears to have lost faith in the cause? But there is no sign that China, the biggest emitter, is wavering.

Less than a decade ago, China was dragging its feet, believing that the West was trying to use climate change as an excuse to impose policies that would harm China’s economy. In 2009, China’s intransigence was one of the main reasons why U.N.-led climate-change talks in Copenhagen failed to make much progress.

But by the U.N.’s conference in Paris in 2015, much had changed. Li Shuo, a Beijing-based policy adviser for Greenpeace, said China was one of the “major driving forces” behind the consensus that was forged at the meeting.

For China’s leaders, the reasons why they changed their minds remain just as valid today. Officials still worry about the huge buildup of debt and damage to the environment that have accompanied years of breakneck growth (citizens’ complaints about polluted air, water and soil have been fueling social unrest). The government now wants the economy to be less reliant on manufacturing that requires a lot of polluting energy, and less driven by massive investment in construction. This will involve using less coal, which in turn will help clear the air as well as reduce climate-changing emissions of carbon.

The government is spooked by an accumulation of research showing just how vulnerable the country is to damage caused by climate change. A study published in 2013 by the World Bank and the OECD concluded that economic losses in Guangzhou, in southern China, would be greater than in any other city in the world. In 2015, the government’s chief meteorologist warned of “serious threats” to China’s rivers, food supplies and infrastructure as a result of global warming, which he said had been greater than the global average.

China sees diplomatic benefit, too, in hanging tough on climate change. It talks of the “soft power” it won by pushing for the agreement in Paris. Shortly before Trump’s inauguration, Chinese leader Xi Jinping told a gathering of the world’s elite in Davos, Switzerland, that all signatories should stick to the Paris accord “instead of walking away from it” — a poke at Trump that his audience applauded.

Also that month, China’s climate envoy, Xie Zhenhua, ventured that his country was “capable of taking a leadership role in combating global climate change.” China is reluctant to stick its neck out in negotiations on global warming, but it enjoys the kudos of leading by example.

Chinese officials are blessed by the absence of a domestic lobby that questions climate change and its causes. “People generally see the urgency” of the problem, said Li of Greenpeace. But there are powerful vested interests that resist carbon-cutting measures.

Take the steel industry. It is heavily polluting and a huge consumer of coal-produced energy. The central government said it wants to cut steel production, but some local authorities have been ignoring its orders, partly because of the risk of protests by laid-off workers. Output of the metal still exceeds domestic demand by about one-seventh, or 100 million tons a year.

But the government is succeeding in cutting the use of coal, which provides around 70 percent of China’s electricity. In 2016 coal consumption dropped by 4.7 percent, the third successive year of decline. Many experts now believe it reached its peak in 2013, several years before even the most optimistic of them had been predicting. Greenpeace forecasts that this year will be China’s fourth successive one with flat or falling emissions of carbon dioxide.

China also hopes to profit from developing green technology that it can sell globally. In January it announced plans to spend $360 billion by 2020 on new generating capacity using renewable or low-carbon sources, including solar, wind, hydroelectric and nuclear plants. It says this will create 13 million jobs and mean that half of the new capacity built between 2016 and 2020 will be renewable or nuclear (although China’s record in attaching wind and solar farms to the grid has been less impressive than its rapid building of them).

The country is eager to experiment with other ways of reducing greenhouse gases. Later this year it plans to launch a nationwide carbon-trading scheme, mainly for heavy industries. It is also mulling the introduction of a carbon tax. The public will cheer: less carbon spewed into the air should mean less smog. “We will make our skies blue again,” Premier Li Keqiang said. He is mindful of potential unrest if China doesn’t. His resolve might help the planet, too.