The House passed a bill Tuesday that would both prevent a government shutdown and suspend the debt limit in a step toward preventing possible economic calamity.

The chamber approved the plan in a 220-211 vote. All Democrats voted for it and all Republicans opposed it.

As the bill heads to the Senate, Republicans are threatening to block it, which could leave Democrats scrambling to find another way to avoid a federal funding lapse — or even a first-ever default on U.S. debt. Worries about a looming default and the economic damage it would cause contributed to a U.S. stock market drubbing on Monday.

Congress has to pass a funding plan by Sept. 30 to prevent a shutdown. Separately, the U.S. will exhaust all of its options to keep paying its bills sometime in October, Treasury Secretary Janet Yellen has told congressional leaders.

The House-passed plan would keep the government running through Dec. 3. It would also suspend the debt ceiling into Dec. 2022.

The bill would put $28.6 billion toward natural disaster relief and $6.3 billion toward resettlement of Afghan refugees.

Senate Minority Leader Mitch McConnell, R-Ky., has said Republicans will vote for a standalone funding bill but not legislation with a debt limit suspension attached.

While Democrats have pointed out that the GOP signed off on huge emergency coronavirus relief bills since the last debt ceiling suspension, Republicans have said their counterparts should move to prevent default on their own as they prepare to pass a mammoth spending bill without the GOP.

Ahead of the House vote, Senate Majority Leader Chuck Schumer, D-N.Y., warned Republicans that failure to raise the debt ceiling could wreak havoc on the economy and critical government benefits such as Social Security.

“This is playing with fire. Playing games with the debt ceiling is playing with fire and putting it on the back of the American people,” he said Tuesday.

It is unclear how Democrats would proceed if the legislation fails in the Senate.

They could attach a debt ceiling suspension to their $3.5 trillion budget reconciliation bill. Doing so would add more steps to an already chaotic and time-consuming process.

The proposal, the centerpiece of President Joe Biden’s domestic agenda, would make massive investments in the social safety net and climate policy. Republicans want Democrats to tie the debt limit suspension to the sprawling bill, which Democrats want to pay for through tax increases on corporations and the wealthy.

Subscribe to CNBC on YouTube.