In a startling turnabout, Senate Majority Leader Chuck Schumer and Sen. Joe Manchin announced Wednesday they had reached an expansive agreement that had eluded them for months on health care, energy and climate issues, taxes on higher earners and corporations and federal debt reduction.

The two Democrats said the Senate would vote on the wide-ranging measure next week, setting up President Joe Biden and Democrats for an unexpected victory in the runup to November congressional elections in which their control of Congress is in peril. A House vote would come afterward, perhaps later in August. Unanimous Republican opposition in both chambers seems certain.

Just hours earlier, the expectation was that Schumer, D-N.Y., and Manchin, D-W.Va., were at loggerheads and headed toward far narrower package that Manchin was insisting be limited to curbing pharmaceutical prices and extending federal health care subsidies. Earlier Wednesday, numerous Democratic senators had said they were all but resigned to the more modest legislation.

The reversal was stunning, and there was no immediate explanation for Manchin’s abrupt willingness to back a bolder, broader measure. Since last year, the West Virginian had used his pivotal vote in the 50-50 Senate to force Biden and Democrats to abandon far more ambitious and expensive versions of the package. He dragged them through months of negotiations in which leaders’ concessions to shrink the legislation proved fruitless, antagonizing the White House and most congressional Democrats.

“This is the action the American people have been waiting for. This addresses the problems of today — high health care costs and overall inflation — as well as investments in our energy security for the future,” Biden said in a statement. He added, “If enacted, this legislation will be historic, and I urge the Senate to move on this bill as soon as possible, and for the House to follow as well.”

Tellingly, Democrats were calling the measure “The Inflation Reduction Act of 2022” because of its provisions aimed at helping Americans cope with this year’s dramatically rising consumer costs. Polls show that inflation, embodied by gasoline prices that surpassed $5 per gallon before easing, has been voters’ chief concern. For months, Manchin’s opposition to proposed, larger packages has been premised in part on his worry that they would fuel inflation.

The measure also seemed to offer something for many Democratic constituencies.

Also Read | What US housing market entering a recession means

It dangled tax hikes on the wealthy and big corporations and environmental initiatives for progressives. And Manchin, an advocate for the fossil fuels his state produces, said the bill would invest in technologies for carbon-based and clean energy while also reducing methane and carbon emissions.

Manchin said the new measure “would dedicate hundreds of billions of dollars to deficit reduction by adopting a tax policy that protects small businesses and working-class Americans while ensuring that large corporations and the ultra-wealthy pay their fair share in taxes.”

The overall proposal is far more modest that the $3.5 trillion package Biden asked Democrats to push through Congress last year, and the pared-down roughly $2 trillion version that the House approved last November after Manchin insisted on shrinking it. Even then, Manchin shot down that smaller measure in December, asserting it would fuel inflation and was loaded with budget gimmicks.

In a summary that provided scant detail, Democrats said Wednesday their proposal would raise $739 billion over the decade in new revenue. That included $313 billion from a 15% corporate minimum tax that a Manchin statement suggested would affect only “billion-dollar companies or larger.”

The agreement also contains $288 billion the government would save from curbing pharmaceutical prices, $124 billion from beefing up IRS tax enforcement and $14 billion from taxing some “carried interest” profits earned by partners in entities like private equity or hedge funds.

The measure would spend $369 billion on energy and climate change initiatives and $64 billion to extend federal subsidies for three more years for some people buying private health insurance. Those subsidies, which lower people’s premiums, would otherwise expire at the end of this year.

That would leave $306 billion for debt reduction, an effort Manchin has been demanding. While a substantial sum, that’s a small fraction of the trillions in cumulative deficits the government is projected to amass over the coming decade.

Sen. Kyrsten Sinema, D-Ariz., who backed Manchin last year in insisting on making the legislation less expensive but objected to proposals to raise tax rates, was still reviewing the agreement, said spokeswoman Hannah Hurley. The spokeswoman referred a reporter to Sinema comments last year supporting a corporate minimum tax.

Sen. John Cornyn, R-Texas, said the Democratic agreement would be “devastating to American families and small businesses. Raising taxes on job creators, crushing energy producers with new regulations, and stifling innovators looking for new cures will only make this recession worse, not better.”

But if Democrats can hold their troops together, GOP opposition would not stop them.

The key is Democratic unity. They can prevail if they lose no more than four votes in the House and remain solidly united in the 50-50 Senate, where Vice President Kamala Harris can cast the tie-breaking vote.

“Rather than risking more inflation with trillions in new spending, this bill will cut the inflation taxes Americans are paying, lower the cost of health insurance and prescription drugs, and ensure our country invests in the energy security and climate change solutions we need to remain a global superpower through innovation rather than elimination,” Manchin said.

Schumer and Manchin said Democratic leaders’ proposals this fall to revamp permitting procedures would help infrastructure like pipelines and export facilities “be efficiently and responsibly built to deliver energy safely around the country and to our allies.”

Also Read | Where to invest during high inflation

Collin O’Mara, president and CEO of the National Wildlife Federation, hailed Manchin’s announcement. “This agreement affirms that we can address the climate crisis, lower costs for consumers, lift up frontline and rural communities, and invest in made-in-America jobs and clean energy innovation,” O’Mara said.

Sierra Club Legislative Director Melinda Pierce took a more cautious approach. “We are eager to see text of this legislation, and are grateful that Biden and Schumer have remained resolute in finding a path to pass once-in-a-generation investments in our communities, our economy, and our future,” she said.

Manchin just last week said he would only agree to far more limited legislation curbing prescription drug costs and extending federal subsidies for health care costs.

He said he was open to considering a broader compromise on environment and tax issues after Congress returned from a summer recess in September, an offer that many Democrats considered dubious.