Lawmakers voted overwhelmingly in favour of the government's bill tabled in March, which also includes new intermediate targets for 2030 and 2040.
The carbon neutrality goal, backed by a large coalition of parties last year, brings forward the government's previous commitment to reaching it by 2050.
The government said it was in the process of establishing a climate policy council to provide an independent assessment of the compatibility of the government's overall policy with its climate goals.
"Today's decision shows that Sweden will continue to be a leading country in global efforts to achieve the ambitious goals of the Paris Agreement," said Isabella Lovin, Sweden's climate minister and deputy prime minister.
The approval of the climate act, which is set to enter into force on 1 January 2018, follows the announcement by the US president, Donald Trump, just two weeks ago that he will pull the US out of the global climate agreement.
The Swedish green and liberal think tank Fores described the law as the most ambitious of its kind in the world, adding that the "concrete", long-term goals will give the market the certainty it needs to kickstart a transformation.
According to Windpower Intelligence, the research and data division of Windpower Monthly, Sweden has roughly 6.5GW of wind capacity installed.
In January 2017, a roadmap to help Sweden achieve "100% renewable energy production by 2040" was published by the country's parliamentary energy commission.