The world added more solar power capacity than fossil fuels in 2017, a sign of the sector's strength.

The sector attracted $160.8 billion in investment in 2017.

China was the biggest investor in renewable energy in 2017, sinking $126.6 billion into the industry, a 30% increase over 2016.

The world added more solar power capacity than any other type of energy in 2017, outpacing all fossil fuels, according to a new report from the United Nations Environment Programme (UNEP).

In 2017, solar energy attracted $160.8 billion in investment in 2017, an 18% increase over 2016.

Renewable energy, including wind, hydro, and solar, supplied a record 12% of the world's energy needs, according to the report.

Global investment in renewable energy held steady over last year, with over $200 billion invested. China was the biggest contributor, sinking $126.6 billion alone into the sector, a 30% increase over 2016, according to the report.

Since 2004, the world has invested over $2.9 trillion into renewable energy.

The chart below shows net capacity growth for different electricity sources, factoring in power plant closures. Coal was the hardest hit, according to Carbon Brief: