On a party-line vote, Senate Democrats approved sweeping legislation on health care, climate change, and taxes on Sunday, delivering a major victory for President Joe Biden and his agenda ahead of the midterm elections.

The Senate passed the Inflation Reduction Act, which includes record spending on clean energy initiatives, prescription drug price reductions, and a tax overhaul to ensure that large corporations pay income taxes. Every Democrat voted in favor of the bill, while every Republican voted against it.

It will be voted on in the Democratic-controlled House, where it is expected to pass as early as Friday.

On the Senate floor before the final vote, Senate Majority Leader Chuck Schumer, D-N.Y., called the bill a “defining legislative feat of the twenty-first century” and “the boldest climate package in U.S. history.” After a grueling overnight session of debate, amendments, and negotiation, Vice President Kamala Harris cast the deciding vote in favor of the measure. Harris cast the deciding vote on final passage after a 15-hour “vote-a-rama” that began at 11:30 p.m.

The legislation, which was initially negotiated by Schumer and Sen. Joe Manchin, D-W.Va., addresses long-standing liberal priorities. During a tumultuous year of negotiations among Democrats, the White House’s loftier ambitions to expand the social safety net in last year’s Build Back Better bill were scrapped.

Senate Minority Leader Mitch McConnell, R-Ky., had a different take on the $739 billion package, which would raise corporate taxes while reducing the deficit by about $100 billion over the next decade.

The bill would allow Medicare to negotiate prescription drug prices, which the pharmaceutical industry has long opposed, and would extend Affordable Care Act subsidies for three more years, until 2025.

To address climate change, the bill includes $10 billion in tax credits for the construction of electric vehicles, solar panels, and wind turbines; $7,500 tax credit rebates for consumers purchasing electric vehicles; and $9 billion for low-income Americans to retrofit their homes with energy-efficient features.

There is up to $20 billion in loans to support electric vehicle plants, $20 billion in climate change assistance for farmers and ranchers, and $30 billion for cities and states to transition utilities to clean electricity. To pay for these and other measures, the bill would establish a 15% corporate minimum tax and beef up enforcement of the Internal Revenue Service.

The bill would generate approximately $739 billion in tax revenue, more than offsetting the proposed $433 billion in spending. According to the Congressional Budget Office, the legislation would reduce the federal deficit by $102 billion over the next decade.

Republicans amended the bill to remove a $35 monthly cap on insulin co-pays, claiming the provision violated procedural rules. Senators Bill Cassidy of Louisiana, Susan Collins of Maine, Josh Hawley of Missouri, Cindy Hyde-Smith of Mississippi, Sen. John Kennedy of Louisiana, Lisa Murkowski of Alaska, and Dan Sullivan of Alaska voted with Democrats to keep the measure in place.

In the bill, Democrats reduced the cost of insulin through Medicare, whereas Republicans’ amendment only addressed the cap on insulin co-pays for private insurers.

Negotiations for the legislation appeared to be dead on several occasions before resuming in recent weeks and culminating in a surprise agreement by Schumer and Manchin last week.

Democrats secured enough support to pass the bill in the Senate’s evenly divided chamber when Sen. Kyrsten Sinema, D-Ariz., said Thursday she would vote for it if drought relief and tax changes were included.

Democrats framed and titled the legislation as a way to reduce consumer costs in the face of 40-year-high inflation, but economists disagree on how effective it would be in that regard. The Penn Wharton budget model at the University of Pennsylvania predicted that the impact on inflation would be “statistically indistinguishable from zero” in the long run and would slightly increase inflation before 2024.

According to Moody’s Analytics, the bill will “nudge the economy and inflation in the right direction, while meaningfully addressing climate change and reducing the government’s budget deficits.”

Throughout the negotiations, he told his caucus that they “were going to have to swallow some bad stuff to get the good stuff,” such as permitting reform supported by Manchin and seen as beneficial to the fossil fuel industry.