Updated Sept. 10 with Gov. Jerry Brown signing the legislation.

California solidified its role as a world leader on climate action as Gov. Jerry Brown signed legislation to shift the state to 100 percent carbon-free electricity by 2045.

The legislation, along with an executive order establishing a target for the state to become carbon neutral by the same year, are among the crowning environmental achievements of Brown's administration, which ends in January.

In a summer when California has been fighting record wildfires while facing off against the Trump administration's attempts to rollback climate policies, the state's Democratic-controlled legislature sought to double down on its commitment to shift away from fossil fuels. Last year's attempt to pass the legislation fell short. This year, it made it.

"After a grueling year it has finally passed," state Sen. Kevin de León, the Los Angeles Democrat who sponsored the measure, wrote on Twitter on Aug. 28 after the Assembly voted. De León, who is challenging fellow Democrat Sen. Dianne Feinstein for her U.S. Senate seat in November, was in the Assembly chamber to help round up the final votes.

"Our state will remain a climate change leader," he said.

Sign up for InsideClimate News Weekly Our stories. Your inbox. Every weekend.

California already has one of the strongest clean energy mandates in the country, with a commitment to obtain 50 percent of its electricity from wind, solar and geothermal power by 2030. The new law increases that 2030 commitment to 60 percent, on the way to fully carbon-free electricity by 2045.

The state currently gets 29 percent of its power from renewables and 24 percent from hydropower and nuclear. A decade ago, only 11 percent of its power came from renewable energy.

In his executive order setting a goal of statewide carbon neutrality by 2045, Brown talked about further reducing emissions across the economy and sequestering carbon through soil and forest management. Once the state becomes carbon neutral—with the amount of carbon emitted offset by carbon pulled from the atmosphere—the goal would be net negative emissions.

The stakes are high as global temperatures rise. California's geography and long coastline put it in the path of some of the worst impacts of climate change, and a comprehensive climate assessment published earlier by the state this week projects that wildfire, drought, heat waves and floods will grow more frequent and severe.

What Would 100% Zero-Carbon Power Mean?

California isn't the first state to commit to carbon-free electricity; Hawaii set a 100 percent renewable energy goal in 2015. But as the most populous state and the fifth-largest economy in the world, California's decision would be a landmark in the global effort to drive down carbon emissions.

"While Trump is taking the nation backwards by deregulating and subsidizing the coal, oil, and natural gas industries in D.C., California is rolling up its sleeves to build bold climate protections," said Paul Cort, an attorney for the environmental group Earthjustice who led the California Right to Zero campaign.

"Victory for humankind and science-based 100 percent roadmaps," tweeted Stanford University professor Mark Jacobson, who has published studies on the feasibility of a global transition to all-renewable electricity.

As the bill made its way through the Legislature, Jacobson and his colleagues faced off against conservative critics like Robert Bryce of the Manhattan Institute for Policy Studies, who warned in a Los Angeles Times editorial that the legislation would "require wrecking vast onshore and offshore territories with forests of wind turbines and sprawling solar projects." The Manhattan Institute has in the past received funding from the petrochemical billionaire Koch brothers and Exxon Foundation.

The carbon-free electricity commitment will also help California meet its ambitious goals of putting 1.5 million zero-emission vehicles on its roads by 2025, and 5 million by 2030. Currently, even though California leads the nation in electric cars, those vehicles still draw power from a grid that gets 34 percent of its electricity from natural gas, its largest source, and 4 percent from coal. As recently as 2008, California obtained 46 percent of its power from natural gas and 11 percent from coal.

Leading Climate Charge as Trump Backpedals

The move to ramp up California's climate commitment comes as President Donald Trump's administration is pushing in the opposite direction.

In recent weeks, the Trump administration has proposed ending state obligations to decarbonize electricity under the Obama administration's Clean Power Plan and weakening fuel economy standards while revoking California's long-standing authority to establish its own greenhouse gas emissions standards and zero-emissions vehicle program.

The state is bracing to fight the Trump administration in the courts. Meanwhile, lawmakers in Sacramento are doing their part to push back on Trump's fossil-fuel-friendly agenda. In May, they approved legislation to require all new homes built in the state to have solar power. They also passed more than a dozen other bills designed to cut emissions, including measures to incentivize electric vehicles and zero-emissions building technologies. [Update: Brown signed that package of bills on Sept. 13 during the Global Climate Action Summit.]

"California keeps proving we know to invent a future few could even imagine," former Gov. Arnold Schwarzenegger said in a letter urging lawmakers to pass the 100 percent carbon-free electricity legislation.

Former Vice President Al Gore also weighed in with his endorsement. "While our federal leadership is failing to act to solve the climate crisis," he said in a letter, "it is imperative that California continue its world-renowned efforts to reduce global warming pollution and provide a blueprint for other states and nations on how to address climate change while continuing to grow your economy."