President Donald Trump accompanied by Vice President Mike Pence, listens as House Minority Leader Nancy Pelosi of Calif., speaks before a meeting with congressional leaders including House Speaker Paul Ryan of Wis., Senate Majority Leader Mitch McConnell of Ky., and Senate Minority Leader Chuck Schumer of N.Y., in the Oval Office of the White House, Thursday, Dec. 7, 2017, in Washington. (AP Photo/Alex Brandon)
President Donald Trump accompanied by Vice President Mike Pence, listens as House Minority Leader Nancy Pelosi of Calif., speaks before a meeting with congressional leaders including House Speaker Paul Ryan of Wis., Senate Majority Leader Mitch McConnell of Ky., and Senate Minority Leader Chuck Schumer of N.Y., in the Oval Office of the White House, Thursday, Dec. 7, 2017, in Washington. (AP Photo/Alex Brandon) Credit: Alex Brandon

Washington — Congress passed a short-term spending bill on Thursday, avoiding a partial government shutdown in the coming days but setting up a more heated spending fight later this month.

The measure to extend government funding until Dec. 22 passed the House and Senate by comfortable margins. President Donald Trump indicated he will sign the stopgap deal, averting a partial government shutdown that had been set to take effect at 12:01 Saturday morning.

Congressional leaders of both parties went to the White House on Thursday afternoon to begin talks with Trump on a long-term spending pact.

“We’re all here today as a very friendly, well-unified group, well-knit-together group of people,” Trump said at the top of the Oval Office meeting. “We hope that we’re going to make some great progress for our country. I think that will happen, and we’ll appreciate it very much.”

But there are clear obstacles to any deal. Trump himself cast doubt on Wednesday, telling reporters that Democrats “want to have illegal immigrants pouring into our country, bringing with them crime, tremendous amounts of crime.” A shutdown over the issue, he said, “could happen.”

The short-term deal passed in part because it maintained the status quo on government spending levels and policies. Both parties are preparing for a spending and policy fight as they eye a longer-term deal.

The chairman of the House Freedom Caucus, a group of hard-line conservatives who have bucked GOP leaders on past government spending bills, warned that any bipartisan deal on spending risked a Republican revolt later this month.

“It takes two bodies to put something into law, and the president’s agreement to a caps deal does not mean that it is fiscally the best thing for the country,” Rep. Mark Meadows, R-N.C., said. “I want to avoid a headline that says President Trump’s administration just passed the highest spending levels in U.S. history.”

The statements have cast a pall over the high-stakes spending talks on Thursday, which are expected to be an initial step in a weekslong dance over funding the government and resolving several other partisan standoffs.

Republicans have majorities in both chambers of Congress, but they cannot pass spending bills alone. In the Senate, a 60-vote supermajority is required to pass most major legislation, and Republicans control 52 seats. That means negotiating with Democrats, who have pushed to maintain their own domestic spending priorities, as well as policy initiatives on immigration, health care and more.

Speaking to reporters Thursday morning, House Minority Leader Nancy Pelosi, D-Calif., laid out a host of Democratic demands, ranging from funding for veterans and to fight the opioid crisis to passage of a bill that would grant legal status to hundreds of thousands of “dreamers” — immigrants brought without documentation to the United States as children.

The main source of the Democrats’ leverage, however, is the GOP desire to hike military spending to more than $600 billion in 2018.