The head-snapping turn of events, which has generated a joyful case of whiplash among Democrats and environmentalists, is a reminder of how domestic politics is intertwined with worldwide diplomacy.
Advocates feared that last month's breakdown in negotiations in Congress had undermined efforts to limit the catastrophic effects of global warming. Now they're energized by the opportunity to tout an unprecedented U.S. success.
``This says, `We're back, baby,''' said Jennifer Turner, who works on international climate issues as director of the Woodrow Wilson Center's China Environment Forum in Washington.
The legislation, which also has provisions on taxes and prescription drugs, includes about $375 billion over the next decade for clean energy development and financial incentives for buying electric cars, installing solar panels and weaning the power grid off fossil fuels. Although the proposals were downsized during difficult negotiations, it's the single biggest investment in climate change in U.S. history, and a significant shift from years of inaction that limited Washington's clout overseas.
The Senate passed the legislation on Sunday, and the House is expected to approve it on Friday. Then it goes to President Joe Biden for his signature.
Poor nations remain concerned that rich countries like the United States have not fulfilled financial commitments to help them cope with global warming and transition to clean energy, something the legislation does not address. But Biden can still point to it as evidence that the U.S. political system can address the world's most pressing problems.
``Our ability to have credibility on the global stage depends on our ability to deliver at home,'' said Ali Zaidi, the White House deputy national climate adviser. ``We are the pace car. That helps other people go faster and faster.''
After President Donald Trump withdrew from the Paris climate accord, Biden entered office pledging to rejoin the fight against global warming. He set an ambitious new target for reducing greenhouse gas emissions _ at least 50% below 2005 levels by 2030 _ and began proposing policies to put the country on track.
The legislation that Biden is expected to sign is estimated to reduce emissions between 31% to 44%, according to an analysis by the Rhodium Group, an independent research firm. Further regulatory steps by the administration could close the rest of the gap.
``It's good that finally the U.S. is trying to catch up after years of dragging its feet on climate change and this investment will go a long way to undoing some of the harm caused by the administration of President Trump,`` said Mohamed Adow, director of Power Shift Africa, a think tank based in Nairobi, Kenya.
The movement on the bill comes just three months before the next U.N. conference on climate change, which is known as COP27 and will take place in Egypt.
``Let's hope this legislation is the start of more international cooperation in the lead up to the COP27 summit, where the most vulnerable get the support they need,'' Adow said.
Although the U.S. will still face entrenched skepticism, the progress in Washington may also give John Kerry, the White House's special envoy on climate, more momentum going into the conference in November.
``It puts wind in his sail, it gives him a real credibility boost,'' Turner said. ``This will change the whole dynamic.``
Several experts said the U.S. will be empowered to put more pressure on China, India and other nations that have high emissions but have been unwilling to cut back for economic reasons.
``This restores some diplomatic legitimacy to the U.S. as an influential player in international climate negotiations,'' said Scott Moore, director of China Programs and Strategic Initiatives at the University of Pennsylvania.
Shayak Sengupta, a fellow at the Observer Research Foundation America, a Washington-based affiliate of a think tank in India, was less enthusiastic.
``Considering that this bill is long over due after years of U.S. climate inaction, many countries may view this as the `bare minimum' of the U.S.'s historical and moral responsibility for climate,'' he said.
Sengupta emphasized that poor nations are still looking for rich countries to fulfill their $100 billion commitment for financial assistance to address global warming, an issue that's been a sore spot during international negotiations.
There will be no shortage of other challenges, too. If Republicans retake Congress or the White House, they could unravel Biden's progress. Supply chains could struggle to accommodate increased demand for equipment like solar panels and batteries. China's foreign ministry on Friday announced the country is cutting off direct climate talks with the U.S. in response to House Speaker Nancy Pelosi's trip to Taiwan, severing a rare point of longstanding, if sometimes tumultuous, cooperation between the two countries.
However, experts said China will still take notice if the U.S. succeeds in becoming a clean energy powerhouse.
``For a while now, China has been leading in clean energy investment globally,'' said Xizhou Zhou, an expert in climate and sustainability at S&P Global, a global research firm. ``They will probably see this legislation as a competitive move.''
Deborah Seligsohn, an expert on China's politics and energy at Villanova University and a former U.S. diplomat in Beijing, said the result could be lower prices globally.
``To the extent the U.S. starts really investing in things that compete with key Chinese businesses _ in solar, wind, electric vehicles, batteries _ I think you're going to see Chinese businesses interested in ramping up their competitiveness in these industries, by making better products and bringing prices down,`` she said.
That could have a ripple effect around the world.
``Developing countries may see prices for renewable energy going down, and adoption going up,`` Seligsohn said.
Vibhuti Garg, an energy economist focused on India, said U.S. investment in clean energy research could pay dividends in poorer nations that don't have the same resources to develop new technologies.
``The U.S. can share the technology know-how with other countries, especially the Global South,'' she said.
Aditya Ramji, from the Institute of Transportation Studies at University of California, Davis, said that cooperation _ along with financial help _ will be critical.
``At some point there will have to be discussions on how they can provide intellectual property access or lower costs to countries like India and others to leverage electric vehicle technology,'' he said.
Climate activists said the U.S. legislation is just one step on a larger path towards climate action. More progress is needed to put the world on track to limit global warming to 1.5 degrees Celsius (2.7 degrees Fahrenheit), a target that some scientists believe is slipping out of reach.
``We need to fight for political commitments in other countries,`` said climate activist Luisa Neubauer, a leading figure in the Fridays for Future activist movement.
``That's the only way we will manage to turn this from a year of fossil fuel backlash to a year of climate justice,'' she said.