In this Nov. 28, 2019, photo, a solar panel installation is seen in Ruicheng County in central China's Shanxi Province. (AP Photo/Sam McNeil)

WASHINGTON (AP) -- As world leaders gather in Spain to discuss how to slow the warming of the planet, a spotlight falls on China -- the top emitter of greenhouse gases.

China burns about half the coal used globally each year. Between 2000 and 2018, its annual carbon emissions nearly tripled, and it now accounts for about 30% of the world's total. Yet it's also the leading market for solar panels, wind turbines and electric vehicles, and it manufactures about two-thirds of solar cells installed worldwide.

"We are witnessing many contradictions in China's energy development," said Kevin Tu, a Beijing-based fellow with the Center on Global Energy Policy at Columbia University. "It's the largest coal market and the largest clean energy market in the world."

That apparent paradox is possible because of the sheer scale of China's energy demands.

But as China's economy slows to the lowest level in a quarter century -- around 6% growth, according to government statistics -- policymakers are doubling down on support for coal and other heavy industries, the traditional backbones of China's energy system and economy. At the same time, the country is reducing subsidies for renewable energy.

At the annual United Nations climate summit, this year in Madrid, government representatives will put the finishing touches on implementing the 2015 Paris Agreement, which set a goal to limit future warming to 1.5 to 2 degrees Celsius above pre-industrial levels. Nations may decide for themselves how to achieve it.

China had previously committed to shifting its energy mix to 20% renewables, including nuclear and hydroelectric energy. Climate experts generally agree that the initial targets pledged in Paris will not be enough to reach the goal, and next year nations are required to articulate more ambitious targets.

Hopes that China would offer to do much more are fading.

Recent media reports and satellite images suggest that China is building or planning to complete new coal power plants with total capacity of 148 gigawatts -- nearly equal to the entire coal-power capacity of the European Union within the next few years, according to an analysis by Global Energy Monitor, a San Francisco-based nonprofit.

Separately, investment in China's renewable energy dropped almost 40 percent in the first half of 2019 compared with the same period last year, according to Bloomberg New Energy Finance, a research organization. The government slashed subsidies for solar energy.

Last week in Beijing, China's vice minister of ecology and environment told reporters that non-fossil-fuel sources already account for 14.3% of the country's energy mix. He did not indicate that China would embrace more stringent targets soon.

"We are still faced with challenges of developing our economy, improving people's livelihood," Zhao Yingmin said.

China is alternately cast as the world's worst climate villain or its potential clean-energy savior, but both superlatives are somewhat misplaced.

As a fast-growing economy, it was always inevitable that China's energy demands would climb steeply. The only question was whether the country could power a sufficiently large portion of its economy with renewables to curb emissions growth.

Many observers took hope from a brief dip in China's carbon emissions between 2014 and 2016, as well as Chinese leader Xi Jinping's statement in 2017 that China had "taken a driving seat in international cooperation to respond to climate change."

Today the country's renewed focus on coal comes as a disappointment.

"Now there's a sense that rather than being a leader, China is the one that is out of step," said Lauri Myllyvirta, lead analyst at the Centre for Research on Energy and Clean Air in Helsinki. He notes that several developed countries -- including Germany, South Korea and the United States -- are rapidly reducing their reliance on coal power.

Fossil fuels such as coal, gasoline and natural gas release carbon dioxide into the atmosphere, trapping heat and changing the climate. Coal is the biggest culprit.

Last year, coal consumption in the United States hit the lowest level in nearly 40 years, according to the U.S. Energy Information Administration.

One place to consider the rise, pause and rise again of China's coal sector is Shanxi province -- a vast mountainous region in central China.

Shanxi is the heart of China's traditional coal country, dotted with large mines, but also the site of some of the country's largest solar and wind-power projects, according to state media.

During most of the past 30 years of rapid economic growth, the coal business boomed in Shanxi and nearby provinces. As China's cities and industries expanded, coal supplied much of that power, and China surpassed the U.S. as the world's top carbon emitter in 2006.

But after climbing sharply for two decades, China's emissions stalled around 2013 and then declined slightly in 2015 and 2016, according to Global Carbon Budget, which tracks emissions worldwide. This dip came as Chinese leaders declared a "war on pollution" and suspended the construction of dozens of planned coal power plants, including some in Shanxi.

At the same time, the government required many existing coal operators to install new equipment in smokestacks to remove sulfur dioxide, nitrous oxide and other hazardous substances. About 80% of coal plants now have scrubbers, said Alvin Lin, Beijing-based China climate and energy policy director for the Natural Resources Defense Council, a nonprofit.

As a result, the air quality in many Chinese cities, including Beijing, improved significantly between 2013 and 2017. Residents long accustomed to wearing face masks and running home air-filter machines enjoyed a reprieve of more "blue sky days," as low-pollution days are known in China.

Annual levels of PM 2.5 -- a tiny but dangerous pollutant -- dropped by roughly a third across China between 2013 and 2017, from 61.8 to 42 micrograms per cubic meter, according to scientists at Beijing's Tsinghua University and other institutions. They made the report in November in the Proceedings of the National Academy of Sciences, a peer-reviewed journal.

"That's a big improvement, although in terms of safe air quality, we're still not there yet," Lin said. China's pollution levels are still well above standards set by the World Health Organization.

While these retrofitted coal plants emit fewer pollutants that harm human health, the scrubbers do not reduce greenhouse gases. "The new plants are good for air quality, but you still have all that carbon dioxide that goes into the atmosphere," Lin said.

In the past three years, China's carbon emissions have begun to rise again, according to Global Carbon Budget.

That trend was evident in the first half of 2019, when China's carbon emissions from fossil fuels and concrete production rose 4%, compared with the same period last year, according to Myllyvirta's preliminary analysis of Chinese government data.

The coming winter in Beijing may see a return of prolonged smog, as authorities loosen environmental controls on heavy industry -- in part to compensate for other slowing sectors in the economy. Cement and steel production remain both energy intensive and heavily polluting.

Permits for new coal plants proliferated after regulatory authority was briefly devolved from Beijing to provincial governments, which see construction projects and coal operations as boosts to local economies and tax bases, said Ted Nace, executive director of Global Energy Monitor.

"It's as though a boa constructor swallowed a giraffe, and now we're watching that bulge move through the system," said Nace. In China, it takes about three years to build a coal plant.

In November, Premier Li Keqiang gave a speech to policymakers emphasizing the importance of domestic coal to energy security.

But because China's coal-power expansion is growing faster than energy demand, overcapacity "is a serious concern now," said Columbia University's Tu.

And once new infrastructure is built, it's hard to ignore.

"It will be politically difficult to tear down a brand-new coal plant that's employing people and supporting a mining operation. It will make it more difficult for China to transition away from coal," Nace said.

The world has already warmed by 1 degree Celsius. All scenarios envisioned by the Intergovernmental Panel on Climate Change for holding planetary warming to around 1.5 degrees Celsius involve steep worldwide reductions in coal-power generation.

In that effort, other countries rely on China to manufacture most of the solar panels installed worldwide, according to an analysis in the journal Science co-authored by Jonas Nahm, an energy expert at Johns Hopkins University.

"If we have any chance to meet climate targets, we have to do a lot by 2030 -- and we won't be able to do it without China's clean-energy supply chain," Nahm said.

China's manufacturing helped bring down the cost of solar panels by 80% between 2008 and 2013. Prices for wind turbines and lithium-ion batteries also dropped significantly, according to Bloomberg New Energy Finance.

"China has a really mixed record. On the one hand, it's seen rapidly rising emissions over the past two decades," Nahm said. "On the other hand, it's shown it's able to innovate around manufacturing -- and make new energy technologies available at scale, faster and cheaper."