Congressional negotiators made progress Saturday on a sweeping stimulus package meant to blunt the devastating impact of the coronavirus pandemic, a deal that is expected to inject upward of $2 trillion into a reeling U.S. economy over the coming months.

But Republicans and Democrats failed to secure an agreement ahead of a self-imposed 5 p.m. deadline, and hopes of a rapid resolution were thrown into doubt when Senate Majority Leader Mitch McConnell (R-Ky.) indicated his party would begin drafting “final legislative text” without a deal with Democrats.

“I believe we are poised to deliver the significant relief that Americans need with the speed that this crisis demands,” McConnell said in a Saturday night statement, with the Senate poised to take its first procedural votes on the package Sunday.

Justin Goodman, a spokesman for Senate Minority Leader Charles E. Schumer (D-N.Y.), said any such announcement was premature: “There is not yet an agreement, and we still have not seen large parts of the Republican draft.”

The immediate fate of the rescue package — likely to become the most expensive fiscal stimulus in American history — could depend on a Sunday morning meeting of the top four congressional leaders. House Speaker Nancy Pelosi (D-Calif.) and House Minority Leader Kevin McCarthy (R-Calif.) will join McConnell and Schumer, as well as Treasury Secretary Steven Mnuchin, to discuss the rescue bill.

Earlier in the day Saturday, GOP senators said an accord was within reach — citing key concessions to Democrats on the expansion of unemployment insurance benefits, emergency health-care funding and other matters.

“Generally speaking, the building blocks of this thing are pretty much in place, and, you know, now some of the differences come down to the finer points of how some of this stuff gets gets done,” said Sen. John Thune (R-S.D.), the No. 2 Republican leader, following a meeting of key GOP negotiators.

Schumer was also upbeat earlier in the evening — telling reporters at the Capitol that he was “optimistic we can get a deal” and that senators would be “working through the night” — before Democratic officials warned of a setback due to McConnell’s decision to end talks and start drafting legislation.

With the nation in the grip of a pandemic that has upended daily life, shuttered businesses, left an untold number out of work and sent stocks plummeting, Republicans and Democrats have stressed the imperative to move quickly on what would be the third emergency aid package in less than three weeks. At the White House, President Trump said the legislation is “going to keep companies together, keep workers paid, so they can live and sustain.” A central proposal would deliver checks as large as $1,200 to most U.S. taxpayers.

Lawmakers signaled progress on key fronts, with McConnell asserting in a late-night statement that the “intense bipartisan talks are very close to a resolution.”

Sen. Charles E. Grassley (R-Iowa), the Finance Committee chairman, said there was “a good bipartisan agreement” to expand unemployment insurance — a top Democratic priority — while Sen. Marco Rubio (R-Fla.) said a deal to provide some $350 billion for small businesses, giving them financial lifeblood during the health crisis, was all but final.

Sen. Lamar Alexander (R-Tenn.), chairman of the Health, Education, Labor and Pensions Committee, said Republicans agreed to a Democratic request to add tens of billions of dollars in emergency aid to hospitals and other parts of the public health infrastructure under massive strain — an influx that Schumer has billed as a “Marshall Plan” for fighting the virus.

Challenges, however, remain: Two officials familiar with the negotiations, who spoke on the condition of anonymity because they were not authorized to comment publicly, said the parties remained divided on how to structure relief measures for larger businesses — including a GOP request to expand the Federal Reserve’s emergency lending program and Democratic requests for restrictions on how firms can use any federal rescue funds.

Underscoring the urgency and rapid pace of the negotiations, Pelosi boarded a flight back to Washington on Saturday after spending the past week at home in San Francisco, according to a senior Democratic aide — indicating she plans to play a central role in negotiating the final plan with Republicans.

Larry Kudlow, director of the National Economic Council, offered the $2 trillion economic impact estimate as he joined Senate negotiations Saturday morning. He put the direct cost of the bill at about $1.4 trillion. A portion of that, he said, would capitalize Federal Reserve emergency lending that could support hundreds of billions of dollars in additional loans.

The U.S. Bureau of Economic Analysis estimates 2019’s gross domestic product at $21.4 trillion. Even a bill of $1.4 trillion would amount to nearly double the cost of the American Recovery and Reinvestment Act — the fiscal stimulus passed during the 2008-2009 global financial crisis.

The ballooning size of the federal coronavirus response has mirrored the escalation of the global health crisis. The legislative response began this month with a $2.5 billion White House request, which grew into an $8.3 billion appropriation directed mainly at public health needs. A follow-up package signed into law Wednesday spent more than $100 billion in initial economic relief, providing free testing for covid-19, the disease the virus causes, and an emergency boost to the federal safety net.

“I expect we’ll have a bill by tomorrow that will have significant Democratic priorities, significant Republican priorities, and, hopefully, we can pass a bill Monday morning and send a strong message to the American people that we’re going to get through this,” Alexander said Saturday.

The thorniest issues involve balancing direct aid to Americans through tax rebates with enhanced unemployment benefits directed through the state unemployment insurance systems. Democrats have argued for a significant boost to the latter, but Republicans have expressed doubts about whether states can handle an influx of the dimensions Democrats have proposed.

Democrats have also pushed for more direct cash aid to states to backfill certain budget shortfalls that could lead to drastic cuts in front-line services. Republicans have instead advocated for increasing aid to existing programs such as Medicaid and encouraging states to tap rainy-day funds, White House legislative affairs director Eric Ueland said late Friday.

One area where negotiators appear to have made progress is on the structure of a small-business lending program, which would use existing Small Business Administration credit programs to inject as much as $350 billion into struggling firms.

Rubio told reporters that level of funding could help sustain companies for six to seven weeks, letting them meet payroll and potentially rehire workers who have been laid off because of the pandemic. Eligible businesses would be those employing fewer than 500 people or those otherwise eligible for SBA lending.

“A large, enormous majority of businesses that qualify will be able to get one of these quickly and really provide some certainty for over a month and a half, maybe longer,” he said.

Schumer said in a CNN interview Saturday evening that frequent meetings and calls with Mnuchin, a key White House negotiator, had generated optimism. He said talks had greatly advanced on the Democrats’ unemployment insurance proposal, a key sticking point earlier in the day: “We haven’t dotted the i’s and crossed the t’s, but, conceptually, I think we’re there.”

The hopeful note stood in contrast to a missive that Pelosi sent to House Democrats on Friday evening, calling an initial Senate GOP measure introduced late Wednesday a “nonstarter.” Any bipartisan agreement, she said, must “greatly increase unemployment insurance and Medi­caid, help small businesses survive, expand paid sick and family leave and put money directly into the hands of those who need it most.”

While Pelosi has not been directly involved in talks, Schumer said Saturday he had consulted with her “hour by hour.” Should the Senate reach a deal and pass it, House members would have to be called back to vote on the bill, a complication unto itself, given the spread of the virus and with two House members announcing they’ve tested positive for it.

“We are talking to each other, and they know exactly what’s in the package, and much of what we want and what they want are very similar,” Schumer said on CNN.

Agreement also appeared near on one major issue — how to structure direct payments to people in a way that would effectively flood the economy with hundreds of billions of dollars in cash. The bill McConnell released Thursday drew bipartisan criticism because many would have gotten one-time payments of $1,200, but the poorest Americans — those without federal tax liability — would have gotten as little as $600.

Throughout the day Friday, lawmakers of both parties and administration officials voiced objections to that structure, and as the talks broke up late Friday, Ueland said they were near agreement on ensuring that the poorest Americans didn’t get less money. Three congressional aides involved in the talks but not authorized to discuss them publicly confirmed Saturday that all taxpayers would receive equal checks.

Schumer and Democrats were pushing to expand unemployment benefits to provide six weeks of full pay while waiving waiting periods and job-search requirements. That would be a sea change for the nation’s unemployment insurance system, which is meant to deliver much smaller checks, not to wholly replace lost wages.

But some Republicans were voicing concerns about the ability of states to administer large-scale increases in the unemployment program, and Labor Secretary Eugene Scalia joined a meeting of senators Friday to issue a warning on that front.

Paul Winfree, a former White House policy aide who now serves as a Heritage Foundation fellow, said conservatives are reluctant to funnel too much money through the unemployment insurance system. An Office of Management and Budget review early in the Trump administration, he said, found states had unspent unemployment insurance balances from the 2009 economic stimulus because they didn’t have the systems in place to easily disburse the money to people who qualified.

Democrats warned that even small disagreements about discrete but closely linked pieces of the bill could inhibit an accord.

“There’s still a lot more to agree on until we agree on everything,” said Sen. Robert Menendez (D-N.J.), a Finance Committee member closely involved in the talks about expanding unemployment insurance funding. “This is going to be the largest, when it’s all concluded, relief package in history. So, yes, speed is necessary, but getting this done right so that it actually has the effect that we want is equally as important.”

Seung Min Kim and Jeff Stein contributed to this report.