Swedish lawmakers, by an overwhelming majority vote (254 against 41), have bound the country to reach net-zero greenhouse-gas emissions by 2045. Only one out of country’s eight political parties didn’t support the Climate Act in parliament yesterday, which comes into action in January 2018.

The Climate Act requires a commitment to report on progress and keep track of Sweden’s progress on its climate goals:

The government’s climate policy must be based on the climate goals and specify how work is to be carried out

The government is required to present a climate report every year in its budget bill

Every four years, the government will draw up a climate policy action plan for how its climate goals will be achieved

More importantly, the law makes Sweden a rare country to commit to a goal that is more ambitious than what it agreed to under the 2015 Paris climate agreement (which said it would achieve carbon neutrality by 2050). Costa Rica, however, committed in the Paris accord to reaching zero emissions sooner than Sweden, in 2021, the only other country with more than a million people to have such an ambitious goal.

“With Donald Trump planning to pull out of the Paris agreement, now more than ever do we need the rest of the world to up its game in combating climate change,” Gareth Redmond-King, head of climate and energy at WWF, told Climate Home. “It is an important victory, not only for Sweden, but for everyone who cares about the future of our environment.”

Sweden has already spent decades decarbonizing its energy supply. In the 1970s, it started building a fleet of nuclear power reactors. In the 1990s, it introduced a carbon tax, which encouraged a move away from fossil fuels. In the 2000s, it started investing more heavily in renewable energy, especially wind and solar. That’s why only a quarter of Sweden’s energy currently comes from fossil fuels, compared with more than four-fifths in the US and the UK.

To be sure, “net-zero” emissions doesn’t mean that in 2045 Sweden won’t emit any greenhouse gases. Instead, the Climate Act commits the country to reduce its absolute emissions by at least 85% below 1990 levels. For the remaining 15%, it plans to offset the emissions by investing in projects that contribute to reducing pollution in Sweden and elsewhere. These projects may involve, for example, funding Indian projects that reduce greenhouse gas emissions there, or in carbon-capture technology, which stops emissions from factories going into the atmosphere and can even pull carbon dioxide out from the air.