The measure, large elements of which appeared dead just weeks ago amid Democratic divisions, would inject more than $370 billion into climate and energy programs. Overall, the bill could allow the United States to cut greenhouse gas emissions about 40 percent below 2005 levels by the end of the decade. It would achieve Democrats’ longtime goal of lowering prescription drug costs by allowing Medicare for the first time to directly negotiate drug prices and capping the amount recipients pay out-of-pocket for drugs each year at $2,000. The measure would also extend larger premium subsidies for health coverage for low- and moderate-income people under the Affordable Care Act for three years. And it would be paid for by significant tax increases, mainly on large companies, including introducing a minimum corporate tax of 15% and imposing a new tax on company share buybacks. Originally billed as “Build Back Better,” a multitrillion-dollar social safety net plan mandated by the Great Society, Democrats watered down the legislation in recent months and rebranded it as the Inflation Reduction Act. It was projected to reduce the federal deficit by as much as $300 billion over a decade, although it remained to be seen whether it would offset inflation or reduce costs for Americans in the long run. The measure’s passage was a major victory for Mr. Biden and Democrats, who are struggling to retain their slim majorities in the House and Senate in November’s midterm elections. Facing unanimous opposition from Republicans, who have used filibusters to block many elements of their domestic agenda, Democrats took full advantage of the Senate’s special budget rules to push through as many of them as possible with the support of all 50 members of the Senate. their parliamentary group. The final tally was 51 to 50, with Vice President Kamala Harris calling the shots. The House planned to break from its summer recess to reconvene briefly on Friday to clear the measure, sending it to Mr. Biden for his signature. “Today, Senate Democrats sided with American families and special interests, voting to lower prescription drug costs, health insurance, and everyday energy costs and reduce the deficit while making the richest corporations finally pay the their share,” Mr. Biden said. in a statement. The Senate vote was the culmination of more than a year of tough negotiations between the party’s progressive core, which demanded a transformation plan that would touch every aspect of American life, and a conservative side seeking a much narrower package. Those talks took place against the backdrop of a 50-50 Senate, in which any defection could have killed the effort — and almost did, several times. “The caucus is very much focused on what’s in this bill – not what’s not in the bill, even though every one of us would like more – because what’s in the bill is so incredible,” he said. Sen. Chuck Schumer of New York, the majority leader; he said in an interview. “You had to thread the needle.” The approval came after a weekend session that included a 16-hour all-night voting marathon in which Republicans tried and failed repeatedly to derail the legislation and Democrats united to defeat almost all of their efforts. Republicans managed to lift the $35 cap on insulin prices for patients with private insurance, challenging it as a violation of Senate rules in a vote that Democrats were sure to use as a political weapon against them before the midterm elections. The insulin price cap for Medicare patients was left untouched in the bill, potentially helping millions of seniors. As part of the landmark climate and energy initiative, which would put the Biden administration within its goal of roughly halving emissions by 2030, the bill would offer tax incentives to steer consumers toward electric vehicles and drives utilities toward renewables. such as wind or solar energy. It also includes millions of dollars in climate resilience funding for tribal governments and Native Hawaiians, as well as $60 billion to help disadvantaged areas disproportionately affected by climate change. For Democrats, the measure’s passage capped a highly successful six-week period that included the final passage of a $280 billion industrial policy bill to boost American competitiveness with China and the largest expansion of veterans benefits in more than two decades. But unlike those bills, the tax and climate legislation passed an evenly divided Senate along party lines, condemned by Republicans as federal overreach and reckless spending at a time when prices remain high across the country. The measure was a far cry from Mr. Biden’s original vision for the plan and the $2.2 trillion measure that the House passed in November. To accommodate the demands and concerns of two inmates, Sens. Joe Manchin III of West Virginia and Kyrsten Sinema of Arizona, Democrats rejected billions of dollars for child care, paid leave and public education and shelved plans to repeal key Republican party figures 2017. tax reform. There was little Republicans could do to stop passage after senators Kyrsten Sinema and Joe Manchin III said they would support the bill. Credit…TJ Kirkpatrick for The New York Times But the final package contained a number of proposals that Democrats have worked for decades to advance. If passed, it would be the most important climate law ever enacted in the United States, investing hundreds of billions of dollars over 10 years in tax credits for manufacturing facilities for things like electric vehicles, wind turbines and solar panels, and $30 billion for additional production tax credits to accelerate domestic manufacturing of solar panels, wind turbines, batteries and processing of critical minerals. It would also impose a fee to punish excessive emissions of methane, a greenhouse gas. The legislation would allow Medicare to negotiate the cost of up to 10 prescription drugs initially, starting in 2026, and give seniors access to free vaccines. Combined with a three-year extension of expanded health care subsidies first approved last year as part of the $1.9 trillion pandemic law, the package is the biggest change in national health policy since the passage of the Affordable Care Act. To finance much of the plan, the measure would establish a new minimum corporate tax of 15% that would apply to the profits that companies report in their financial statements to shareholders, known as accounting income. It would impose a new 1 percent tax on corporate stock buybacks starting in 2023. The measure would also pump $80 billion into the IRS to boost the agency’s enforcement arm and crack down on wealthy corporations and tax evaders. This provision is estimated to raise $124 billion over a decade. “When I finish my term in the Senate, I will look back on passing this bill as one of the most important things I’ve had the opportunity to work on,” said Sen. Tina Smith, D-Minnesota and one of the many climate hawks who pushed for legislation. Congressional Republicans characterized the bill as an excessive spending package with damaging tax increases that would cause more pain to the nation’s economy at a dangerous time. While outside analysis suggested the legislation would reduce the federal budget deficit through the end of the decade and have a limited impact on federal spending, Republicans continued to label it a “reckless tax and spending spree.” “Democrat policies have destroyed the savings, stability and lifestyle that families have worked and sacrificed for years to build,” Sen. Mitch McConnell of Kentucky, the minority leader, said Sunday. “The result of this one-party government has been an economic assault on the American middle class.” It was the second time in less than two years that Democrats attempted a sweeping spending package without any Republican support, after last year’s $1.9 trillion pandemic relief package was passed. As inflation soared in the months after the measure was enacted, Republicans warned that Democrats had exacerbated the financial strain facing American families by passing the legislation. The passage of the legislation was a triumph for Sen. Chuck Schumer, the majority leader, ahead of November’s midterm elections. Credit…Haiyun Jiang/The New York Times Sen. Lindsey Graham of South Carolina, the top Republican on the Appropriations Committee, announced Saturday night that he had “thought long and hard about how to explain this to the American people, and the only thing I can tell you is that insanity is defined as the same thing and expect a different result.” But there was little Republicans could do to stop passage once Mr. Manchin and Ms. Sinema said they would support it. Democrats passed the bill under a special process known as reconciliation that protects fiscal measures from filibusters. There was a price for supporting Mr. Manchin and Ms. Cinema, however. Mr. Manchin ensured that the interests of his coal-producing state were reflected in the final bill. In addition to securing separate commitments to complete construction of a natural gas pipeline in West Virginia and passing a measure to facilitate fast-track permitting for energy infrastructure, he struggled to include tax credits for carbon capture technology and requirements for new drilling leases of oil in Alaska’s Cook Inlet and the…