The stalemate over funding for the Department of Homeland Security (DHS) was broken Wednesday as the Senate voted 98-2 to proceed to legislation that would prevent a partial government shutdown.

Democrats agreed to support the DHS bill after Senate Majority Leader Mitch McConnellAddison (Mitch) Mitchell McConnellDACA recipient claims Trump is holding ‘immigrant youth hostage’ amid quest for wall Former House Republican: Trump will lose the presidency if he backs away from border security Pence quotes MLK in pitch for Trump's immigration proposal MORE (R-Ky.) stripped out provisions inserted by the House that would reverse President Obama's executive actions on immigration. 

The only votes against proceeding to the bill came from Sens. James InhofeJames (Jim) Mountain InhofePressure mounts for Trump to reconsider Syria withdrawal Dems express alarm at Trump missile defense plans Dem senator expresses concern over acting EPA chief's 'speedy promotion' MORE (R-Okla.) and Jeff SessionsJefferson (Jeff) Beauregard SessionsOvernight Health Care: Thousands more migrant children may have been separated | Senate rejects bill to permanently ban federal funds for abortion | Women's March to lobby for 'Medicare for All' Acting AG Whitaker's wife defends him in lengthy email to journalist Watchdog: Thousands more migrant children separated from parents than previously known MORE (R-Ala.).

"Democrats will support getting on the House Homeland Security funding bill. In exchange, the leader will provide the only amendment, [it] will be a clean Homeland Security funding substitute," Senate Minority Leader Harry ReidHarry Mason ReidSenate Republicans eye rules change to speed Trump nominees Harry Reid knocks Ocasio-Cortez's tax proposal: Fast 'radical change' doesn't work Overnight Defense: Trump rejects Graham call to end shutdown | Coast Guard on track to miss Tuesday paychecks | Dems eye Trump, Russia probes | Trump talks with Erdogan after making threat to Turkey's economy MORE (D-Nev.) said. 

Democrats had blocked the bill four times before. With a shutdown of DHS set to begin on Saturday, McConnell on Tuesday agreed to split the funding and immigration fights, as Democrats have long demanded.

Reid said earlier Wednesday that the Senate could take a final vote on the DHS bill Thursday. 

"We look forward to working with our Republican colleagues in the next 24 hours to get this done. All eyes now shift to the House of Representatives," Reid said.

If the Senate passes the funding bill, as expected, it would head back to the House, where its fate is unclear.

Speaker John BoehnerJohn Andrew BoehnerBreaking the impasse on shutdown, border security McCarthy, allies retaliate against Freedom Caucus leader House vote fails to quell storm surrounding Steve King MORE (R-Ohio) was silent Wednesday on the "clean" funding plan and said the House would wait for the Senate to act.

“Until the Senate does something, we're in a wait-and-see mode,” BoehnerJohn Andrew BoehnerBreaking the impasse on shutdown, border security McCarthy, allies retaliate against Freedom Caucus leader House vote fails to quell storm surrounding Steve King MORE said.

Several conservative Republicans have criticized the "clean" plan, with many vowing they will not vote to fund agencies that would be carrying out Obama’s immigration order.

McConnell said separating the two proposals would give Democrats who have previously criticized Obama's immigration action a chance to "prove they're serious."

“Many Senate Democrats led their constituents to believe they’d do something. … We’ve since heard excuses for the Democrats' refusal to do so,” McConnell said. “But the time for refusal has passed.”

Senate Republicans plan to bring up a separate bill that would block Obama's 2014 executive action, which would provide deferred deportations and work visas to millions of illegal immigrants.

Senate Democrats have made clear they would block motions to move to debate on that proposal, put forward by Sen. Susan CollinsSusan Margaret CollinsTrump pitches new plan to reopen government amid Dem pushback The Memo: Concern over shutdown grows in Trump World Overnight Defense: Trump unveils new missile defense plan | Dems express alarm | Shutdown hits Day 27 | Trump cancels Pelosi foreign trip | Senators offer bill to prevent NATO withdrawal MORE (R-Maine), until the House and Senate both pass funding for Homeland Security.

“We’re happy to debate it. We won’t put procedural barriers in the way of debating it once a fully funded DHS bill is on the president’s desk to be signed. That is our view,” Sen. Charles SchumerCharles (Chuck) Ellis SchumerProtecting our judiciary must be a priority in the 116th Congress Baldwin's Trump plays 'Deal or No Deal' with shutdown on 'Saturday Night Live' Sunday shows preview: Shutdown negotiations continue after White House immigration proposal MORE (D-N.Y.), the third-ranking Senate Democrat, told reporters Wednesday.

— Last updated at 4:45 p.m.