The measure would also offer $377 billion in federally guaranteed loans to small businesses and establish a $500 billion government lending program for distressed companies reeling from the impact of the crisis, including allowing the administration the ability to take equity stakes in airlines that received aid to help compensate taxpayers. It would also send $100 billion to hospitals on the front lines of the pandemic.

“This is certainly, in terms of dollars, by far and away the biggest ever, ever done,” President Trump said at the White House, where he veered from his usual partisan vitriol and praised Democrats for their work on the agreement. “That is a tremendous thing because a lot of this money goes to jobs, jobs, jobs — and families, families, families.”

The deal is the product of a marathon set of negotiations among Senate Republicans, Democrats and Mr. Trump’s team that nearly fell apart as Democrats insisted on stronger worker protections, more funds for hospitals and state governments, and tougher oversight over new loan programs intended to bail out distressed businesses.

Anticipation of the vote sent the markets higher for the second consecutive day, with the S&P 500 up a little more than 1 percent. But investors appeared to grow jittery toward the end of trading as a group of Republican senators delayed a final vote over concerns that the jobless aid was so generous that it could lead to layoffs and discourage people from working.

The last-minute snag revealed the tenuous nature of the bipartisan compromise that was at the core of the measure, which emerged from an extraordinary five-day stretch of intense negotiations between lawmakers and White House officials over how to deliver critical financial support to businesses forced to shut their doors, American families and hospitals overwhelmed by the spread of the novel coronavirus. It has already killed more than 900 people and infected more than 68,000 in the United States.