For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

A new report shows that last year the world moved away from relying on fossil fuels and toward replacing them with renewable energy—solar energy in particular.

Solar power “rose to record prominence” in 2017, according to the Global Trends in Renewable Energy Investment report released Thursday by United Nations Environment, the Frankfurt School-UNEP Collaborating Centre, and Bloomberg New Energy Finance. While adoption of renewable energy grew overall—and skyrocketed in China—investment from big markets like the US, the United Kingdom, and Germany dropped off.

In 2017, the world installed an unprecedented amount of solar energy technology—98 gigawatts—more than the net addition of all coal, gas, and nuclear power plants combined. Solar power also attracted far more dollars than any other type of energy—$160.8 billion, up 18 percent from the year before. Investment in new coal and gas projects generated about $103 billion.

Angus McCrone, chief editor of Bloomberg New Energy Finance and lead author of the report, says the worldwide spike in solar energy is remarkable. “It’s pretty amazing when you think that solar, only 10 years ago, was a very small piece,” he says, noting that in 2007, less than 3 gigawatts of solar energy projects were installed globally.

In the US, the numbers on renewable energy are not quite as bright. The report shows US investment dropped 6 percent last year to $40.5 billion, though McCrone cautions that the drop is not big enough to signal a major trend change. Nearly 9 out of 10 Americans support expanding solar power, according to a 2016 Pew Research Center survey, while a majority oppose expanding offshore drilling, nuclear power, fracking, and coal mining.

In 2017, the number of solar industry jobs in the US decreased for the first time in seven years. And earlier this year, the Trump administration imposed a new tariff on solar panels. The Solar Energy Industry Association estimates the tariff will cause the loss of 23,000 US jobs in 2018. “For solar, a trade war is going to play out differently than other industries,” says Samantha Gross, a foreign policy, energy security, and climate initiative fellow at the Brookings Institution. “Unlike in other industries where you would see a lot of trade move around, I think [solar] companies will suck it up and pay the tariffs.”

China’s solar boom led the global surge last year. China created more than half of all new global solar capacity, and accounted for 45 percent of the $279.8 billion spent worldwide on all renewables. Gross explains that China’s growth is driven by the country’s own solar manufacturing, climbing energy needs, ambitious plans addressing climate change, and pollution problems. “China has a growing power demand to serve,” she says. “China also has horrendous local air pollution problems. I don’t want to belittle their climate commitment, but it’s easier for them to build up their renewable energy industry when they are also helping with a more tangible problem. ”

Other developing markets, such as those in Mexico, the United Arab Emirates, and Egypt, also saw a jump in renewable energy investment. Meanwhile, investment declined in more mature renewable energy markets, including in the United Kingdom, Germany, and Japan. The amount of money a country invests in renewable energy “depends a lot on what government support is available,” McCrone explains. For example, the United Kingdom and Germany recently saw shifts in government support—in the case of the UK, the end of some subsidies—and a big fall in investment. And in the future, more countries are likely to move away from government subsidies. “Before long…many projects will have to sink or swim without any government-backed price support,” the report says.

Overall, a record 157 gigawatts of renewable power were commissioned worldwide last year. (Large hydropower was excluded from the renewables analysis.) Although global renewable energy investment was up 2 percent from 2016, it was still 13 percent below the record set in 2015. McCrone notes, however, that costs have dropped significantly in the past two years, and continue to fall. So while the world spent more money on renewables in 2015, it actually generated more renewable energy in 2017.

Since 2004, renewable energy investment has reached a total of $2.9 trillion, and renewable energy now accounts for about 12 percent of all global power.

The amount of electricity generated by renewables is equivalent to avoiding about 1.8 gigatons of carbon dioxide emissions, roughly equal to the amount of CO2 emitted by the entire US transport system.

Last year, carbon dioxide levels in the atmosphere reached 406.5 parts per million, up 2.3 ppm from the previous year, and 2017 was the second hottest on record, behind only the previous year. That fall, Environmental Protection Agency Administrator Scott Pruitt announced a proposal to end the Clean Power Plan, an Obama-era policy to reduce carbon dioxide emissions.

Erik Solheim, head of UN Environment, says he is confident that US renewable energy investment will continue because industry decisions will “not be decided by politics, but by the market.” The new report sends a strong message to consumers and investors that solar energy is here to stay, he says. “It shows that solar can take on fossil fuels,” Solheim says. “Solar can compete.”