WASHINGTON ― Less than 48 hours before a government shutdown, House and Senate lawmakers passed a stopgap spending bill on Thursday to fund the government through Dec. 22.

The House passed the bill 235-193, with 18 Republicans voting no and 14 Democrats voting yes, and the Senate passed the bill soon after 81-14, with six Republicans, seven Democrats and one independent who caucuses with the Democrats (Bernie Sanders of Vermont) voting no. The measure will now go toPresident Donald Trump’s desk for his signature.

In the House, Democrats waited for Republicans to put up the votes required for passage before some of their more vulnerable members supported the two-week funding extension.

Republican leaders huddled around a computer on the GOP side monitoring who was voting for the bill, with Majority Whip Steve Scalise (R-La.) signaling to Freedom Caucus Chairman Mark Meadows (R-N.C.) how many more votes Republicans needed to pass the bill. A number of Freedom Caucus members ended up voting for the bill, though of the 18 Republicans in opposition, 12 are members of the Freedom Caucus.

The two-week continuing resolution will allow lawmakers to work out another spending deal before members leave for Christmas break. Republicans and Democrats are currently negotiating over the spending numbers for defense and nondefense for an even larger appropriations agreement.

Speaker Paul Ryan (R-Wis.) and Senate Majority Leader Mitch McConnell (R-Ky.) joined Senate Minority Leader Chuck Schumer (D-N.Y.) and House Minority Leader Nancy Pelosi (D-Calif.) at the White House on Thursday afternoon to discuss the way forward on a spending deal with the president and vice president.

“We had a productive conversation on a wide variety of issues. Nothing specific has been agreed to, but discussions continue,” Schumer and Pelosi said in a joint statement after the meeting.

Once Republicans and Democrats agree to the overall budget numbers, appropriators will take roughly two weeks to write spending bills based on those levels for the rest of the fiscal year, which goes through September.

Recent offers between the two sides have not been that far off, but there still isn’t an agreement on the spending levels or what will be included in the eventual deal. Democrats (and some Republicans) are looking to include a number of other legislative priorities ― Obamacare subsidies, a reauthorization of the Children’s Health Insurance Program, as well as a fix for the Deferred Action for Childhood Arrivals immigration program ― and negotiations on those items could be just as tricky as the spending agreement.

But lawmakers are still confident they’ll be able to sort out a deal to avoid a government shutdown, both at the end of December and in January.