A long-awaited bill meant to reduce health costs, reduce greenhouse gas emissions and raise taxes on corporations and wealthy investors was signed into law by President Biden on Tuesday.

The bill is the biggest step forward on climate ever, Mr. Biden said after drawing a standing ovation from a White House crowd.

The inflation reduction act invests $370 billion in spending and tax credits in low emission forms of energy to fight climate change It extends federal health-insurance subsidies, allows the government to negotiate prescription drug prices for seniors on Medicare and is expected to reduce the federal budget deficit.

New taxes would be imposed on large corporations. A minimum tax on large firms that use deductions and other methods to reduce their tax bill is included in the law. It bolsters funding for the IRS in order to crack down on tax evasion and collect hundreds of billions of dollars that are owed to the government but not paid by high earners and corporations.

The House and Senate were both passed along party lines.

America's largest investment to fight climate change is represented by the bill. The goal is to help the United States cut greenhouse gas emissions by at least 40 percent. Mr. Biden wants the country to cut emissions by at least 50 percent over that time period.

It looked like Mr. Biden wouldn't have a bill to sign. Despite winning bipartisan victories on funding for infrastructure, including roads, bridges, water systems and high-speed internet, the president had been unable to bring his party together on a final bill to carry as much as possible of his economic agenda.

The agreement to go forward was made possible by a last-hour compromise between Senators Chuck Schumer of New York, a Democrat and the majority leader, and a holdout centrist Democrat, Joe Manchin III of West Virginia. Lawmakers joined Mr. Biden at the signing of the bill.

"For anyone who thought Washington was broken and couldn't do big things, Democrats have shown real change is possible," Mr. Schumer said.

Mr. Biden gestured towards Mr. Manchin in his speech. He said he never had doubts.

Michael D. Shear and Lisa Friedman were involved in the report.