BEIJING—China’s efforts to wean itself off coal are losing steam, as the world’s biggest carbon emitter is putting economic growth and energy security above its ambitions to be a leader in combating climate change.

Coal consumption is back near peak levels after rebounding over the past three years, despite China’s pledges to make steep cuts in what is the country’s most prevalent and polluting source of energy. The country is building more coal-fired plant capacity than the rest of the world combined.

Infrastructure stimulus measures to offset the impact of the prolonged trade war with the U.S. have boosted consumption, while Beijing has taken a softer stance on coal use after a missile attack in September on Saudi Arabia, China’s biggest source of oil imports, underscored the country’s reliance on foreign energy.

The renewed focus on coal has raised doubts among analysts over China’s commitment to cutting carbon emissions and frustrated the European Union, which has leaned on China to uphold the Paris Agreement since President Trump pulled the U.S. out in 2017. While China is on track to meet its goals through 2020 and 2030, its mixed signals on coal suggest Beijing is less willing to pursue green-energy goals and join the EU in setting more ambitious emission targets.

“China was seen, particularly by the developing and emerging economies, as the leader, saying look at all the wonderful stuff we’re doing,” said Philip Andrews-Speed, senior principal fellow at the Energy Studies Institute at the National University of Singapore. But the country has continued construction on new coal plants even as it aims to phase out the fossil fuel, he said: “There’s a deep contradiction in this.”