Michael Collins, Eliza Collins and Michael Collins | USA TODAY

AP

Getty Images

WASHINGTON – Congress approved a spending bill Thursday that will fund federal agencies at current levels for another two weeks, avoiding for now the threat of a government shutdown.

The short-term measure is designed to keep the government open through Dec. 22 while lawmakers try to work out an agreement on military spending, immigration and other issues.

The House approved the bill on a 235-193 vote. An hour later, the Senate followed suit and passed it on 81-14 vote. The measure now goes to President Trump for his signature. Earlier in the day, Trump had met with congressional leaders from both parties.

Without the bill, the government would have run out of money at midnight Friday.

While the legislation eliminates the threat of an immediate shutdown, it does not resolve questions about how the government should be funded down the road.

More negotiations will be needed to come up with a long-term funding bill, and those talks could bump up against the Christmas holiday, when lawmakers will again be tasked with passing another spending measure or risking a government shutdown.

In the House, the bill passed by a wide margin, but getting it over the finish line proved difficult for Speaker Paul Ryan and other GOP leaders.

In the days leading up to the vote, members of the hardline conservative House Freedom Caucus threatened to vote against the deal unless they were allowed input in the next-round of funding negotiations. Eighteen Republicans ended up voting against the legislation, while only 14 Democrats voted for it.

Democrats lamented the process used to approve the legislation and argued that Republicans had squandered time that could have been used to deal with long-term funding for issues such as the opioid crisis, children’s health insurance and other issues.

“Why would we need another two weeks when (Republicans) had all this time to work on these issues?” said Rep. Rose DeLauro, D-Conn.

Rep. Mike Simpson, R-Idaho, conceded that a short-term funding measure isn't ideal for funding the government, but argued "it's the only responsible vote" because more time is needed to come up with a longer spending plan.

“A vote against this resolution is a vote to shut down the government," he said.

In the next round of spending talks, Democrats are hoping to negotiate legal protections for the nearly 800,000 undocumented immigrants who came to the U.S. as children and had been shielded from deportation under an Obama-era executive order.

President Trump reversed the Deferred Action for Childhood Arrivals program, or DACA, in September but gave Congress six months to come up with a solution. Democrats and a growing number of Republicans say that Congress can't wait until just before the deadline to find a solution.

“January and February are not the most productive months in Washington ... I don’t want the fate of these young people to be hung in the balance,” Sen. Dick Durbin of Illinois, who is one of the most vocal advocates of a solution for DACA recipients before the end of the year, said on a call with reporters Thursday.

Durbin has been participating in bipartisan negotiations with his Senate colleagues and said that Democrats had offered a proposal that combined legislation that includes a pathway to citizenship and language strengthening border enforcement pulled from a Republican immigration bill.

“This is a serious offer to enhance border security which the Democrats will support and I hope that will be sufficient,” Durbin said.

Sen. Thom Tillis is one of the Republicans working on negotiations with Durbin and his colleagues. Tillis told USA TODAY he would also like to see a solution before the end of the year but added that lawmakers have three more months to finish their work. The North Carolina Republican warned against Democrats using the threat of a shutdown to force a deal on DACA.

While dozens of Republicans said they’d like to see a deal before the end of the year, just two House members — both from Florida — Rep. Carlos Curbelo and Rep. Ileana Ros-Lehtinen have said they’d vote against any year-end spending deal that didn’t include an immigration deal.

House Minority Leader Nancy Pelosi, D-Calif., told reporters Thursday that Democrats had no intention of shutting down the government, but, she cautioned “we will not leave here in December without a DACA fix.”

‘We show good faith, we definitely want to keep the government open, but at the end of the day, not just DACA, but there are a series of things — parity for domestic spending to defense and DACA and children’s health insurance and federally qualified health centers," New Jersey Sen. Bob Menendez, a Democrat, told USA TODAY about the two-week spending vote. "So the next vote, which will now bring us towards the end of the year, that’ll be one where either we will have a deal, or we will have a problem."

Trump and congressional leaders from both parties met Thursday before the votes in the House and Senate but reached no agreements on the issues expected to be key to the negotiations that will begin now that a shutdown has been avoided.

"We hope that we're going to make some great progress for our country. I think that will happen," said Trump, who has previously criticized Democrats for wanting to include immigration provisions in a new spending plan.

Pelosi and Senate Minority Leader Chuck Schumer visited the White House after canceling a similar meeting scheduled for last week because Trump said he didn't think it would be possible to reach a deal.

In a joint statement after the White House meeting, Schumer and Pelosi said, "nothing specific has been agreed to, but discussions continue."

The meeting also included Republicans leaders — House Speaker Paul Ryan of Wisconsin and Senate Majority Leader Mitch McConnell of Kentucky.