The House and Senate late Thursday approved a short-term funding bill that would keep the federal government operating through Dec. 22, providing more time for both parties to negotiate with President Trump on a full fiscal 2018 spending deal.

The bill would keep the federal government open past Friday, when funding expires, and it passed the House shortly after Republican and Democratic leaders met with the president to start discussing a long-term deal.

House Republicans managed to pass the bill in a 235-193 vote, despite some objections from a faction of their most conservative wing, and warnings from Democratic leaders that they won't support any spending bill until a deal is done that funds the government for the rest of fiscal year 2018.

The Senate cleared the bill, by a tally of 81 to 14, later in the evening, sending the measure to President Trump's desk ahead of a Dec. 8 deadline.

House Appropriations Committee Chairman Rodney Frelinghuysen, R-N.J., said the House will have to pass another short-term bill before Dec. 22 that would fund the government, “into the New Year, to keep the government open and ensure all the important federal services are available to all Americans.”

Republicans are hoping these short-term bills give leaders and the White House time to negotiate a final deal that can pass the Senate, where some Democrats will need to be on board in order for the bill to pass.

Only 14 Democrats voted for the bill in the House, and 18 Republicans voted against it. Most Democrats followed the lead of Minority Leader Nancy Pelosi, D-Calif., who is withholding party approval of a spending deal in exchange for a deal to legalize so-called Dreamers as well as a long-term deal on funding a federal health insurance program for low-income children.

Democrats also want a long-term funding deal that lifts federally imposed spending caps, they said, although Republicans have argued Democrats walked away from those negotiations by insisting on the inclusion of Dreamer legislation, which would legalize young people who arrived in the United States illegally as children.

“The Democrats have said all year there must be a deal to raise spending caps in order to enact appropriation bills,” Rep. Nita Lowey, the top Democrat on the Appropriations Committee said. “Instead of heeding that advice, the majority is stumbling from crisis to crisis” with temporary spending bills.

On the other side, Republicans want to ensure a final spending bill for 2018 includes tough border security measures and funding for Trump's border wall, something Democrats flatly reject. It's that fight that has prevented both sides from reaching a long-term agreement.

Senate Minority Leader Chuck Schumer, D-N.Y., signaled on Tuesday was willing to support a two-week deal to allow negotiations to continue with Republicans on a larger accord. Senate Democrats have little choice but to vote for the short-term bill because they would likely take most of the blame for a partial government shutdown if they block the spending bill that requires their votes for passage.

House Speaker Paul Ryan, R-Wis., said Thursday the House cannot produce and pass a fiscal 2018 spending bill in time for the end of the year. Instead, a second bill lasting into the new year will be required.

That spending bill, according to Republicans, would likely be accompanied by supplemental spending for states and territories damaged by hurricanes and wildfires. Republicans also plan to pass full-year funding for the military, which has argued it is harmed when it is funded by a string of short-term legislation.

Defense Secretary Jim Mattis was the only Cabinet member other than Trump and Vice President Mike Pence included in Thursday’s meeting with Republican and Democratic leadership.

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

Pelosi and Schumer said they are eager to find an agreement on lifting spending caps and passing Dreamer legislation, among other issues.

“Democrats continue to press for action on the urgent, bipartisan priorities before Congress: to strengthen our national defense with parity for our domestic budget, to fund veterans and the fight against opioids, to address CHIP and Community Health Centers, to save Americans’ endangered pensions, and to pass the DREAM Act," they said.

Republicans put out a statement also calling for a spending deal but calling for the DREAM Act language to be "a separate process and not used to hold hostage funding on our men and women in uniform."