China’s utilities will be required to buy all the power produced by wind farms and other renewable sources under a new law meant to promote the industry and reduce heavy reliance on coal.

Legislators approved the measure on Saturday as an amendment to China’s 2006 renewable energy law, the official Xinhua News Agency reported.

Beijing has set ambitious goals for wind, solar and other renewable energy in an effort to clean up its environment and curb surging demand for imported oil and gas, which communist leaders see as a strategic weakness.

The measure also could help Beijing fulfil promises to restrain growth in emissions of carbon dioxide and other gases blamed for changing the climate.

“The legislation on improving the consumption of clean energy contributes to the global fight on climate change,” said Wang Zhongying, director of the renewable energy development centre of the Cabinet’s main planning agency, according to Xinhua.

Other countries such as Germany and Spain also promote solar, wind and other renewable power sources by requiring utilities to buy it and to pay higher prices than for electricity from coal and other traditional sources.