The world is going green. 

Global spending on renewable energy is outpacing investment in electricity from traditional energy sources like coal, natural gas and nuclear power plants, according to a report by the International Energy Agency. 

Investments in renewable energy totaled $297 billion in 2016, the last time full-year data was available. That's more than twice the $143 billion that was spent on fossil fuels and nuclear power. The IEA estimates that renewable energy will account for 56% of net generating capacity added through 2025. 

Demand for renewable energy is expected to increase 7% to 30% by 2022, according to the IEA.

The increase in investment comes as wind and solar energy represent the cheapest options for generating electricity after years of research and development. 

China, which has a notorious air pollution problem, has helped lower the cost of renewables by investing heavily in domestic solar manufacturing, creating a glut of inexpensive solar panels. 

Hydroelectric power consumption has also seen growth in non-OPEC countries, according to the IEA, growing at an annual rate of nearly 4% between 1990 and 2015.