WASHINGTON (AP) — President Donald Trump signed an unprecedented $2.2 trillion economic rescue package into law Friday, after swift and near-unanimous action by Congress this week to support businesses, rush resources to overburdened health care providers and help struggling families during the deepening coronavirus epidemic.

Acting with unity and resolve unseen since the 9/11 attacks, Washington moved urgently to stem an economic free fall caused by widespread restrictions meant to slow the spread of the virus that have shuttered schools, closed businesses and brought American life in many places to a virtual standstill.

“This will deliver urgently needed relief,” Trump said as he signed the bill in the Oval Office, flanked only by Republican lawmakers. He thanked members of both parties for putting Americans “first.”

Earlier Friday, the House of Representatives gave near-unanimous approval by voice vote after an impassioned session conducted along the social distancing guidelines imposed by the crisis. Many lawmakers sped to Washington to participate — their numbers swollen after a maverick Republican signaled he’d try to force a roll call vote — though dozens of others remained safely in their home districts.

The Senate passed the bill unanimously late Wednesday.

“The American people deserve a government-wide, visionary, evidence-based response to address these threats to their lives and their livelihood and they need it now,” said House Speaker Nancy Pelosi, D-Calif.

The $2.2 trillion legislation will speed government payments of $1,200 to most Americans and increase jobless benefits for millions of people thrown out of work. Businesses big and small will get loans, grants and tax breaks. It will send unprecedented billions to states and local governments, and the nation’s all but overwhelmed health care system.

“This pathogen does not recognize party lines, and no partisan solution will defeat it. Neither will the government acting alone,” said GOP Whip Liz Cheney of Wyoming. “This is not a time for cynicism or invective or second-guessing. This is a time to remember that we are citizens of the greatest nation on Earth, that we have overcome every challenge we have faced, and we will overcome this one.”

Despite reservations, arch conservatives joined with progressives like Alexandria Ocasio-Cortez, D-N.Y., to back the bill, which moved quickly through a Congress that’s been battered by partisanship and is itself not immune to the suffering the virus has caused. Rep. Joe Cunningham, D-S.C., announced Friday that he has tested positive, just the latest infection in Congress.

Tea party Republicans said government orders to shutter businesses merited actions that conflict with small-government ideology. Liberals accepted generous corporate rescues that accompany larger unemployment benefits, deferrals of student loans, and an enormous surge of funding for health care and other agencies responding to the crisis.

“I’m going to have to vote for something that has things in it that break my heart,” said conservative Rep. David Schweikert, R-Ariz.

Many lawmakers summoned the bipartisan spirit of 9/11 and efforts to fight terrorism. Others praised the roles low-income workers play in keeping the country going and the heroism of health care workers. Some, like Iowa Democrat Abby Finkenauer, who had just learned of two additional coronavirus-related deaths in her district, came close to tears.

Others couldn’t restrain their partisan impulses. Republicans chided Democratic leaders for delays and provisions they see as extraneous, such as funding for public broadcasting and the arts; Democrats said too many elements are a bailout for corporations that may not need it.

Still, in a chamber increasingly dominated by lawmakers whose chief skill often seems to be partisan attacks, Friday’s debate was a noteworthy break.

“We have no time to dither,” said Rep. Gerald Connolly, D-Va. “We have no time to engage in ideological or petty partisan fights. Our country needs us as one.”

The run-up to the vote contained an element of drama because libertarian conservative Thomas Massie, R-Ky., announced plans to seek a vote. The leaders of both parties united to prevent that because it would have forced lawmakers back to the Capitol or blemished their voting records if they stayed home. Instead, they made sure enough lawmakers would attend Friday’s session to block Massie’s move under the rules, and lawmakers took the unprecedented step of sitting in the visitors galleries to establish the necessary quorum.

The House promptly adjourned for a weeks-long recess but will return later in the spring to consider further legislation.

“This bill is not only a rescue package, it’s a commitment — a commitment that your government, and the people whom you elected to serve you, will do everything we can to limit the harm and hardship you face, both now and in the foreseeable future,” said Minority Leader Kevin McCarthy.

The legislation will give $1,200 direct payments to individuals and make way for a flood of subsidized loans, grants and tax breaks to businesses facing extinction in an economic shutdown caused as Americans self-isolate by the tens of millions. It dwarfs prior Washington responses to crises like 9/11, the 2008 financial crisis, and natural disasters.

The massive CARES Act started as a draft plan among Republicans controlling the Senate who were seeking a greater voice in the coronavirus response efforts — especially after Pelosi was a dominant force in earlier legislation imposing a sick leave mandate on businesses.

Senate Majority Leader Mitch McConnell, R-Ky., welcomed Democratic participation a week ago, and signed off on a major expansion of unemployment insurance, but his efforts to freeze out Pelosi and force a quick agreement were met with Democratic demands for large infusions of aid to states and hospitals, as well as an assortment of smaller items. McConnell and top Senate Democrat Chuck Schumer of New York wrestled for days, along with Treasury Secretary Steven Mnuchin and other administration officials.

Negotiations finally produced a deal early Wednesday morning, and the Senate passed the measure by a 96-0 vote.

Key elements are untested, such as grants to small businesses to keep workers on payroll and complex lending programs to larger businesses. Rebate payments will go to people who have retained their jobs. Agencies like the Small Business Administration and state unemployment systems will be severely taxed, and conservatives fear that a new, generous unemployment benefit will dissuade jobless people from returning to the workforce.

The bill amounts to a bridge loan for much of the economy and carries a price tag that equals half the size of the entire $4 trillion-plus annual federal budget.

The legislation also establishes a $454 billion program for guaranteed, subsidized loans to larger industries in hopes of leveraging up to $4.5 trillion in lending to distressed businesses, states, and municipalities.

There is also $150 billion devoted to the health care system, including $100 billion for grants to hospitals and other health care providers buckling under the strain of COVID-19 caseloads.

It also seeks to strengthen the safety net for the poor and homeless. Schools and students would get relief, small business loans payments would be deferred. Evictions from public housing would be put on pause.

Republicans successfully pressed for an employee retention tax credit designed to help companies keep workers on payroll. Companies would also be able to defer payment of the 6.2% Social Security payroll tax. A huge tax break for interest costs and operating losses limited by the 2017 tax overhaul was restored at a $200 billion cost in a boon for the real estate sector.

Most people who contract the new coronavirus have mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia, or death.

AP writer Zeke Miller contributed.