WASHINGTON (AP) — An exhausted Senate narrowly approved a $1.9 trillion COVID-19 relief bill Saturday as President Joe Biden and his Democratic allies notched a victory they called crucial for hoisting the country out of the pandemic and economic doldrums.

After laboring all night on a mountain of amendments — nearly all from Republicans and rejected — bleary-eyed senators approved the sprawling package on a 50-49 party-line vote. That sets up final congressional approval by the House next week so lawmakers can whisk it to Biden for his signature.

The huge measure — its total spending is nearly one-tenth the size of the entire U.S. economy — is Biden’s biggest early priority. It stands as his formula for addressing the deadly virus and a limping economy, twin crises that have afflicted the country for a year.

“This nation has suffered too much for much too long,” Biden told reporters at the White House after the vote. “And everything in this package is designed to relieve the suffering and to meet the most urgent needs of the nation, and put us in a better position to prevail.”

Saturday’s vote was also a crucial political moment for Biden and Democrats, who need nothing short of party unanimity in a 50-50 Senate they run with Vice President Kamala Harris’ tiebreaking vote. They have a slim 10-vote House edge.

Not a single Republican backed the bill in the Senate or when it initially passed the House, underscoring the barbed partisan environment that’s so far characterizing the early days of Biden’s presidency.

A small but pivotal band of moderate Democrats leveraged changes in the legislation that incensed progressives, not making it any easier for Speaker Nancy Pelosi, D-Calif., to guide the measure through the House. But rejection of their first, signature bill was not an option for Democrats, who face two years of trying to run Congress with virtually no room for error.

“They feel like we do, we have to get this done,” Senate Majority Leader Chuck Schumer, D-N.Y., said of the House. He said he’d spoken to Pelosi about the Senate’s changes and added, “It’s not going to be everything everyone wants. No bill is.”

In a written statement, Pelosi invited Republicans “to join us in recognition of the devastating reality of this vicious virus and economic crisis and of the need for decisive action.”

The bill provides direct payments of up to $1,400 for most Americans and extended emergency unemployment benefits. There are vast piles of spending for COVID-19 vaccines and testing, states and cities, schools and ailing industries, along with tax breaks to help lower-earning people, families with children and consumers buying health insurance.

Republicans call the measure a wasteful spending spree for Democrats’ liberal allies that ignores recent indications that the pandemic and economy could be turning the corner.

“The Senate has never spent $2 trillion in a more haphazard way,” said Senate Minority Leader Mitch McConnell, R-Ky. Of Democrats, he said, “Their top priority wasn’t pandemic relief. It was their Washington wish list.”