New York State's $226 billion pension fund will cease investing in certain fossil fuel companies, with the goal of transitioning the massive portfolio away from greenhouse gases entirely by 2040.

The plan was announced by State Comptroller Tom DiNapoli on Wednesday, earning immediate praise from activists and lawmakers who've long pushed for divestment as a tool in combatting the climate crisis.

According to #DivestNY, a coalition campaign that formed after Superstorm Sandy, the announcement marks the most comprehensive divestment commitment to date of any public fund in the world.

The New York State Common Retirement Fund is the third largest pension fund in the country, holding the assets of over 1 million government employees and retirees.

Under the new blueprint, the comptroller will undertake a four-year review to assess whether energy companies in the fund's portfolio can "provide investment returns in light of the global consensus on climate change." Those that don't meet a set of minimum standards will be removed from the portfolio.

Already, the state has divested from 22 coal companies. A review of oil sands companies is expected to be complete in the coming months, followed by inquiries into shale oil stocks, as well as storage products such as pipelines.

The entire portfolio will be decarbonized in two decades, according to the announcement. “Achieving net-zero carbon emissions by 2040 will put the Fund in a strong position for the future mapped out in the Paris Agreement," the comptroller said in a statement.

New York City's pension fund has also committed to divesting $5 billion from fossil fuel companies — though Mayor Bill de Blasio has faced criticism for exaggerating the city's progress toward that goal.

DiNapoli, the state pension fund's lone trustee, had previously rejected calls to divest on the grounds that it could hurt the portfolio's financial performance.

In an op-ed published on Wednesday, Bill McKibben, a leading climate activist and divestment proponent, said the reversal suggested "the once-dominant fossil fuel industry has reached a low in financial and political power."