WASHINGTON — The Senate moved Wednesday evening to pass a $2.2 trillion emergency relief package designed to flood the U.S. economy with money as households and businesses continue to reel from the coronavirus outbreak.

But shortly after announcing the deal, Senate leaders struggled to fend off a number of last-minute snags, and they encountered various hurdles as they tried to write the bill’s fine print.

New York Gov. Andrew Cuomo, a Democrat, has demanded changes to help his state deal with new virus cases. Four Republican senators on Wednesday said a provision in the bill needed to be fixed immediately or it would incentivize people not to return to work. And House Democrats wouldn’t provide a firm timeline of when they might vote to pass the bill.

The final-stage drama was the latest twist for the massive spending bill, which had snowballed from President Donald Trump’s push for an eight-month payroll tax cut into the largest emergency relief bill in American history.

Senate Majority Leader Mitch McConnell, R-Ky., and Minority Leader Charles Schumer, D-N.Y., announced the agreement on the Senate floor at about 1:30 a.m., after a long day of talks with Treasury Secretary Steven Mnuchin and other administration officials.

“I will sign it immediately,” Trump said Wednesday evening as Senate lawmakers tried to set a time for a vote.

The bill would extend $1,200 to most American adults and $500 to most children, create a $500 billion lending program for businesses, cities and states, and another $367 billion employee retention fund for small businesses. It would direct $130 billion to hospitals and provide four months of unemployment insurance, among other things.

Lawmakers and the White House were bombarded with lobbyists and special-interest groups seeking assistance in final days of negotiations, and it snowballed from $850 billion to $2.2 trillion in just a matter of days.

As confirmed coronavirus cases in the United States climbed swiftly to over 60,000 Wednesday with more than 800 deaths, lawmakers themselves acknowledged that no amount of economic relief from Congress could stop the pain for the American public.

Many Americans have filed for unemployment benefits, including 1 million in California this month alone. In addition to layoffs, many workers are dealing with salary reductions or furloughs. And, despite Trump’s hope to restart much of the economy by April 12, there are growing signs that the economic drag could last well into the second half of the year.

House Democrats had said they would vote on the legislation no sooner than 24 hours after it was introduced in the Senate and that the Senate delays kept pushing the bill’s timeline back.

About half of the country’s coronavirus cases are in New York, and the health care system around New York City is completely overwhelmed, Cuomo said. Many hospitals are still rushing to find face masks and other protective equipment. Cuomo said the bill would be “terrible” for his state and added, “We need the House to make adjustments.”

Meanwhile on Wednesday, Sens. Tim Scott, R-S.C., Rick Scott, R-Fla., Ben Sasse, R-Neb., and Lindsey Graham, R-S.C., raised concerns of their own. They said a “drafting error” in the bill would create incentives for companies to lay off workers, instead of retain them on the payroll, complaining that the design of unemployment benefits would allow some workers to make more money on unemployment than at work. But it was unclear if Senate leaders would make the change — the provision was a key demand from Democrats.

Later Wednesday, Trump told reporters he had spoken with some of the senators to address their concern, and White House officials did not expect the issue to derail the bill from passage.

“Our expectation is this bill passes tonight and gets to the House tomorrow,” Mnuchin said.

The legislation ensures that taxpayer-backed loans cannot go to firms controlled by Trump, other White House officials or members of Congress. This means that Trump-owned properties, including hotels that have been affected, cannot seek taxpayer assistance.

The airline industry, which has suffered huge losses in the past two months because of canceled flights and travel restrictions, would be a top recipient in the bill. Passenger airlines would qualify for $25 billion in loans and certain other guarantees and also have access to $25 billion in things such as grants, that might not have to be repaid.

Sen. Patrick Toomey, R-Pa., said he would have preferred long-term low-interest loans to airlines, instead of grants, “But we had this argument, we had this discussion, and it turned out the way it did.”

He said he intended to support the legislation as written.

Cargo airlines and suppliers would qualify for a different batch of money.

Another provision of the bill would authorize $17 billion in assistance for companies deemed crucial for U.S. national security.

There’s also an employee retention tax credit for many firms affected by the coronavirus, and provisions to allow businesses to defer payment of payroll taxes for two years.

The legislation’s significant boost to unemployment benefits would expand eligibility and increase payments by giving laid-off workers $600 a week for four months on top of the benefits already provided by states. Mnuchin described the approach as the most efficient method available, since the alternative would be dealing with individual state systems, some of which are badly outdated.

The surge of new applicants for jobless claims has flooded a system that isn’t designed for a flood of new applicants. But even with all the new funding, it’s unclear how smoothly any of the changes might work. For example, the bill would dramatically expand the Small Business Administration’s ability to guarantee loans, but millions of companies could seek these guarantees all at once, putting enormous pressure on a system that has never been tested in such a manner.

After falling 10,000 points in two months, the Dow Jones industrial average regained more than 2,500 points Tuesday and Wednesday amid optimism about the recovery package. The precise effect of the legislation could take months to understand. Many businesses have been hammered, perhaps beyond repair, by the economic impact of the virus.

The prolonged effects could be different in various parts of the country.

As the bill was coming together in the final days, Democrats fought to make numerous changes. For example, the White House and Republicans agreed to allow an oversight board and create a Treasury Department special inspector general for pandemic recovery to scrutinize the lending decisions and detect abusive or fraudulent behavior.

The bill also contains a grab bag of provisions that might seem to range far afield from the coronavirus pandemic, including $13 million for Howard University, $25 million for Washington’s Kennedy Center for the Performing Arts, and $75 million for the National Endowment for the Arts and Humanities National Endowment for the Arts. Senate aides said those allocations and others are justified to help the institutions prepare for and respond to the coronavirus.

Although Republicans have been attacking the inclusion of funding for the Kennedy Center, Trump said he personally approved of it, saying, “the Kennedy Center has suffered greatly.” Trump noted that it started out as a Democrat request, adding, “You know, it works that way. The Democrats have treated us fairly. I really believe that we’ve had a very good back-and-forth. And I say that with respect to Chuck Schumer.”

Trump acknowledged, though, that assisting an institution like the Kennedy Center might come across like “not a good soundbite but that’s the way life works.”

If the Senate passes the bill, the next step is a little less clear. The House is out of session, so action there could take longer, depending on whether lawmakers can agree to pass the bill by “unanimous consent,” which would require agreement from all members of the chamber.

One outspoken liberal — Rep. Alexandria Ocasio-Cortez, D-N.Y. — has already suggested she could oppose it.

Many members have voiced concern about returning to the tight quarters of the Capitol, with at least two House members testing positive for coronavirus and others in quarantine. Another option, which McCarthy endorsed Wednesday, would be to pass the legislation by “voice vote” in the House. That could allow any members who wanted to return to Washington to debate the issue publicly to do so, before passing the legislation without a roll-call vote that would require a quorum to be present. McCarthy suggested time for debate should be allowed on the House floor.

“I know we’re in a very challenging time, but I don’t think we should pass a $2 trillion package by unanimous consent,” McCarthy said.

Still, all sides expressed eagerness to move swiftly.

“This is going to be enormous help for the American workers and the American economy,” Mnuchin said.

Congress already has passed two smaller coronavirus relief bills: an $8.3 billion emergency supplemental measure for the health-care system and a $100-billion-plus bill to boost paid sick leave and unemployment insurance and provide free coronavirus testing.