In six years, Costa Rica plans to be carbon neutral. It’s getting closer to that goal: In March, the government announced that the country has been running on nothing but renewable electricity in 2015.

Compare that to the U.S., where renewables generate only around 13% of electricity. Of course, Costa Rica is tiny in comparison–with a population only about the size of Alabama. Because most people are relatively poor, energy use per household is low. And the country’s economy relies on tourism and agriculture, not energy-sucking industries like manufacturing. Costa Rica also has some natural advantages. Like Iceland, which already runs on fully renewable energy, Costa Rica is filled with volcanoes and can tap into geothermal power.

The country’s ability to swear off fossil fuels this year also took some luck. Most of the country’s electricity comes from hydropower, and thanks to recent heavy rains, hydroplants have been able to supply more power than usual.

That reliance on hydro also puts Costa Rica at risk in the case of future drought. So to prepare for drier weather that’s likely to come with climate change, the country is investing in more geothermal power. Though the grid doesn’t rely on much wind or solar power yet, there’s an opportunity for both. By some estimates, there’s twice as much sunshine in Costa Rica as in Germany–a country that was able to supply 50% of its electric power from solar on a sunny day last summer.

“Solar is a reliable source, independent from climate change, with a minimum environmental impact,” says Sofía Blanco, the executive director of Acesolar, a nonprofit that hopes to help solar energy grow in Costa Rica.

“Drought is synonymous with crisis in many areas, not just energy,” she says. “That’s why we promote the diversification of the energy matrix.”

It’s likely that the grid in Costa Rica will continue to evolve and the current streak without fossil fuels may not last. Still, the country’s progress is an inspiration for the rest of the world. Only a handful of others–like Albania, Paraguay, and Iceland–run on 100% renewable electricity now.