Update, July 22: Gov. Andrew Cuomo has signed the Climate Leadership and Community Protection Act into law. Our explainer, first published June 20, follows:

New York is the fourth most populous state in the US and its third-largest economy. Now it is poised to adopt the country’s most ambitious climate targets, including 100 percent carbon-free electricity by 2040 and economy-wide, net-zero carbon emissions by 2050.

On Tuesday night, the state Senate passed the Climate Leadership and Community Protection Act, and on Wednesday night, the state Assembly passed it. All it requires now is a signature from Gov. Andrew Cuomo.

This is a big deal.

In passing bold climate legislation, New York will follow in the footsteps of Maine, Oregon, Washington, Colorado, New Mexico, California, and New Jersey, all of which have passed substantive clean energy policies in the past year or so. (Hawaii has had its 100 percent renewables target in place since 2015.)

And New York accomplished this feat the exact same way all those other states did it: by electing overwhelming Democratic majorities.

For years, the state Assembly has been under the control of Democrats, but in the Senate, the Independent Democratic Conference (IDC), a small group of conservative Democrats, caucused with Republicans, effectively giving Republicans control. Cuomo accepted and even encouraged this state of affairs, as it gave him tremendous personal power and infuriated his Democratic critics.

So for four years in a row, a broad coalition pushed the Climate and Community Protection Act (CCPA) through the assembly only to have it die in the Senate.

However, in the 2018 elections, the IDC got crushed, Cuomo got scared to the left by a challenge from Cynthia Nixon, and Democrats finally got the dual majorities they needed, which they immediately put to use with measures on voting rights, abortion, and protections for renters.

Last year, Cuomo put forward his own climate bill, the Climate Leadership Act, which he referred to as a Green New Deal for New York, annoying pretty much everyone. That bill contained electricity carbon goals but no economy-wide carbon goals, and nothing at all on equity.

But activists kept pushing (recently, a broad group of scholars intervened to help them), and finally, late on Wednesday night, the very last day of the legislative session, the bill was passed. (Cuomo is expected to sign it this week.) Miracles are real!

So what’s in it?

The bill that passed — renamed, for reasons no one can quite explain, the Climate Leadership and Community Protection Act (CLCPA) — is closer to the old CCPA than it is to the governor’s bill, but it has a few key changes and amendments, which we’ll get into below.

Altogether, the final product represents an enormous victory for New York’s climate advocacy community, especially in the face of Cuomo’s long record of ... unhelpfulness. Let’s have a look.

100 percent, economy-wide net-zero carbon emissions by 2050

Originally, the CCPA targeted zero carbon emissions, economy-wide, by 2050. After the compromise, the CLCPA now targets net zero by 2050. (With an interim target: 40 percent reductions from 1990 emissions by 2030.)

The difference between “zero” and “net zero” is that only 85 percent of the reductions must come from New York’s own energy and industrial emissions; the remaining 15 percent can come from carbon offsets (e.g., from forestry or agriculture).

Activists are not thrilled with this, but it was arguably a necessary concession. There’s a case to be made that the state simply doesn’t have the statutory authority necessary to get to zero — there will inevitably be some hard-to-reach emissions, outside state authority, that require offsetting. Offsets also create an income stream for good forestry and ag practices.

The bill contains a number of provisions meant to avoid some of the negative effects offsets have had in other programs.

Stationary electric sources — power plants — cannot avail themselves of offsets. They are often located in disadvantaged communities, and anyway, it is well understood how to eliminate their emissions.

Offsets are reserved for facilities or processes where the technology for full elimination of carbon is not yet commercially available (think, for example, cement mixing). For those facilities, there will be a review every four years to ensure that they are using the best available technology (BAT) for reducing emissions before purchasing offsets.

All offsets must come from within 25 miles of the purchaser, to ensure that the benefits stay within local communities. Offset projects must benefit the local environment and, where possible, reduce co-pollutants. Biofuels and waste-to-energy projects are prohibited.

Nevertheless, put aside that last 15 percent. Just getting to 85 percent carbon-free will be an enormous lift for an industrialized economy like New York’s. This is the most stringent economy-wide carbon target in the US, in one of the most challenging states. It’s a new benchmark.

The plan to reduce emissions will be made by a council

Rather than specifying the mechanisms by which emissions will be reduced, the legislature set up a process to create a scoping plan, led by a 22-member Climate Action Council. The council will be composed of the heads of various New York state agencies, along with members appointed by the governor, the Senate, and the Assembly. (This is somewhat similar to how California handed over the policy details to its Air Resources Board.)

The council will convene advisory panels on various specific subjects (transportation, land use and local government, industry, etc.) and consult them in developing the scoping plan. It will also convene a just-transition working group to research and advise on workforce training, job impacts, and related matters. And it will consult with the climate justice working group. (That working group is created elsewhere in the bill; it will contain representatives from disadvantaged communities and environmental justice groups, as well as representatives from trade-exposed industries.)

Part of the council’s challenge will be integrating and building on all of the state’s existing climate and clean energy programs. The Natural Resources Defense Council cites “the Regional Greenhouse Gas Initiative (RGGI) to cap and cut carbon pollution from power plants; the $1 billion NY-Sun program to scale up solar power; ChargeNY, EVolve NY, and the Drive Clean Rebate to expand electric vehicle (EV) infrastructure statewide and get more EVs on the road; the state’s initiative to deploy 3,000 megawatts of battery storage by 2030; and a successful Clean Energy Standard to expand renewable energy penetration.”

Stitching all that together will take some doing, and the mandate is wide open. The council could suggest a carbon pricing system (to supplement or enhance RGGI), a variety of regulations, or, like most states, a mix. There are a few parameters: Emission reductions must be real and verifiable; they must be distributed equitably; they must not increase emissions of “co-pollutants”; and they must minimize so-called “leakage,” whereby emitting facilities simply relocate outside the state.

Every four years, the council will issue a comprehensive report on state greenhouse gas emissions and progress, and adjust its plan as needed. (The state will also integrate a social cost of carbon into all agency decisions.)

100 percent carbon-free electricity by 2040

Those who understand deep decarbonization understand that the electricity sector is key to the process. It is both the easiest sector to decarbonize and a means through which to decarbonize the others. (Electrify everything!)

The electricity targets in the bill actually got strengthened in the final compromise. Whereas the CCPA targeted 50 percent renewables by 2030, the CLCPA targets 70 percent renewable electricity by 2030 and 100 percent carbon-free electricity by 2040. (The mechanism for this will be the state’s renewable portfolio standard, administered by the Public Service Commission.)

New York now joins California, Nevada, Hawaii, Washington, New Mexico, Washington, DC, and Puerto Rico in targeting 100 percent clean power.

Also, just for kicks, the bill targets 9,000 MW of offshore wind energy by 2035, 6,000 MW of solar energy by 2025, and a 23 percent increase in energy efficiency.

A third of the benefits go to frontline communities

Originally, the CCPA stipulated that 40 percent of all state investments in climate and clean energy go to “disadvantaged communities” — those most vulnerable to the effects of climate change or most threatened by the transition away from fossil fuels.

Now, after some backroom wrangling, the language has become slightly more opaque. Here’s the relevant section of the CLCPA (just to give you a flavor of what I’ve been squinting at all day):

State agencies, authorities and entities, in consultation with the environmental justice working group and the climate action council, shall, to the extent practicable, invest or direct available and relevant programmatic resources in a manner designed to achieve a goal for disadvantaged communities to receive forty percent of overall benefits of spending on clean energy and energy efficiency programs, projects or investments in the areas of housing, workforce development, pollution reduction, low income energy assistance, energy, transportation and economic development, provided however, that disadvantaged communities shall receive no less than thirty-five percent of the overall benefits of spending on clean energy and energy efficiency programs, projects or investments and provided further that this section shall not alter funds already contracted or committed as of the effective date of this section.

Isn’t legislation fun to read?

Anyway, “40 percent of the investments” has become “probably 40 percent, but no less than 35 percent, of the benefits of the investments.” That’s a bit fuzzier, which is aggravating to the environmental justice community. “Frontline communities need more than a vague commitment for benefits,” Annel Hernandez of the NYC Environmental Justice Alliance told me. “We need direct investments to catalyze our transition to the clean renewable energy economy.”

It’s not yet clear how “disadvantaged communities” will be defined for the purposes of the bill (the climate justice working group will develop criteria, drawing on data from community air-monitoring systems). And it’s not yet clear how “benefits of the investments” will be defined. That’s likely going to mean an annual push-pull battle between activists and state regulators.

Still, it’s worth taking a step back and noting what a huge commitment this is. In California and Oregon, 40 percent of the revenue from cap and trade is set aside for disadvantaged communities, but that’s a single pot of money. New York’s bill ensures that 40 percent (or, ahem, no less than 35 percent) of all state climate and clean energy spending — funds from RGGI, the state’s Clean Energy Fund, any future initiatives established by this program — goes to disadvantaged communities.

That’s potentially many billions of dollars, spread across a range of agencies and programs. It could be a huge engine for lifting up vulnerable communities across the state.

The bill got somewhat screwed on job quality provisions

The bill originally contained a number of provisions meant to ensure that the state creates high-quality jobs, including measures on prevailing wages, apprenticeship programs, preferences for women- and minority-owned businesses, and more.

All of it got stripped out, because elsewhere in the legislature, a different deal was being hammered out, which would have put in place wage and job standards across all state government programs, not just the clean energy ones.

Long story short, at the last minute, that deal fell apart. All that’s left in the CLCPA? “The Act shall be subject to current prevailing wage law.”

That’s kind of thin gruel, especially for the unions that showed up to support the bill: Service Employees International Union 32BJ, New York State Nurses (NYSNA), the Teamsters, and others.

But the broad coalition that has come together over the years behind this bill — NY Renews now boasts more than 180 members, from unions to community groups to state and national environmental groups — is not finished. It plans to continue pushing for job quality measures. And it’s also thinking longer term, about further measures, including something like a tax-and-invest system (like Oregon’s). The struggle will continue.

Why this is a very big deal

Advocates didn’t get everything they wanted, but in the big picture, the CLCPA is a huge, huge win. The country’s third-biggest economy has passed its most ambitious economy-wide climate targets — some of the most ambitious climate targets in the world. And hitting those targets will generate ongoing waves of investment into the state’s worst-off communities.

It is a win for the state’s economy, which will see a boom in innovation and investment. It’s a win for environmental justice, shifting state funding to those most vulnerable. And it’s a win for the climate.

What remains to be seen are the longer-term reverberations this recent flurry of state action will produce. As of now, two of the nation’s three biggest state economies — the West Coast’s biggest and the East Coast’s biggest — are heading for carbon neutrality by midcentury. In between them, a patchwork of climate-forward states is forming.

Right now, it’s happening all and only where Democrats take overwhelming power. But at a certain point, the size of the market for zero-carbon technologies, and the investment that market attracts, will grow so large that other states will jump on board so they aren’t left behind. Companies are not going to want to make two versions of all their products, a dirty version and a clean version. They will want standards harmonized, and standards tend to get harmonized upward, as California has shown again and again.

This is what climate victory, if there is any such thing, is going to look like in the US. It’s not going to happen through persuasion, whereby the fossil fuel industry realizes the error of its ways and releases federal politicians from its grip. The Green New Deal is probably not going to be built in one grand spasm of federal action. Rather, if it happens at all, it will be through grinding out victories where Democrats control things — some states and lots and lots of cities — until economic and social tipping points are reached.

No one knows exactly when that might happen. But there’s no doubt that New York has just accelerated the schedule.