From left, Speaker of the House Paul Ryan, R-Wis., House Majority Whip Steve Scalise, R-La., and Majority Leader Kevin McCarthy, R-Calif., meet with reporters after House Republicans held a closed-door strategy session as the deadline looms to pass a spending bill to fund the government by week's end, on Capitol Hill in Washington, Tuesday, Dec. 5, 2017. (AP Photo/J. Scott Applewhite)

From left, Speaker of the House Paul Ryan, R-Wis., House Majority Whip Steve Scalise, R-La., and Majority Leader Kevin McCarthy, R-Calif., meet with reporters after House Republicans held a closed-door strategy session as the deadline looms to pass a spending bill to fund the government by week's end, on Capitol Hill in Washington, Tuesday, Dec. 5, 2017. (AP Photo/J. Scott Applewhite)

WASHINGTON (AP) — Despite incendiary words from President Donald Trump, Congress seemed on track Wednesday to approving legislation that would avert a partial government shutdown over the weekend as all sides seemed ready to avert a confrontation — for now.

Increasingly confident House leaders planned a Thursday vote on a bill that would keep federal agencies functioning through Dec. 22, and Senate approval was expected to follow. Even the head of the conservative House Freedom Caucus, whose members have been threatening to oppose the measure, predicted passage.

ADVERTISEMENT

“No one wants a shutdown, including Freedom Caucus members,” Rep. Mark Meadows, R-N.C., told reporters.

The moderated tone reflected a sense within both parties that though major differences remain over spending, immigration, health care and other issues, this was no time for a headline-grabbing government closure.

Republicans want the public focus to be on the party’s prized $1.5 trillion tax bill, which they hope to enact by Christmas. They also have no interest in a shutdown that would raise questions about their ability to govern.

While many Democrats seemed likely to oppose the measure, enough were expected to support it in the Senate to allow its passage there. They know they’d still have leverage on subsequent bills needed to keep the government running.

Congressional leaders of both parties planned to meet Trump at the White House on Thursday to bargain over long-term spending limits and other issues that have become entangled with lawmakers’ year-end work.

But Trump unexpectedly tossed a hand grenade into the mix when he told reporters that a shutdown “could happen” and blamed Democrats. He said they want “illegal immigrants pouring into our country, bringing with them crime, tremendous amounts of crime.”

His comments drew a tweet from House Minority Leader Nancy Pelosi, D-Calif., who called Trump “the only person talking about a government shutdown.”

Trump tweeted similar attacks on Democratic leaders shortly before a meeting that was scheduled last week, prompting angered Democrats to boycott it.

This time, the White House followed up with a more accommodating statement that praised Pelosi and Senate Minority Leader Chuck Schumer. The written statement said Trump was glad the two top Democrats had decided to “put their responsibility to the American people above partisanship” and said Trump was anticipating productive talks between “leaders who put their differences aside.”

ADVERTISEMENT

Later, the White House issued another statement indicating Trump would sign the two-week spending extension and laying out its goals for upcoming budget bargaining. It said money for the military including missile defense and security along the border with Mexico “must be prioritized in a long-term funding agreement.”

The two-week bill is aimed at giving negotiators more time to settle differences. The measure also makes money available to several states that are running out of funds for the Children’s Health Insurance Program, a widely popular program that provides medical care to more than 8 million children.

Democrats have been using their leverage to insist on spending boosts for health care, infrastructure and other domestic programs that would match increases Republicans want for defense.

Democrats are also seeking an agreement to extend protections for hundreds of thousands of immigrants who arrived in the U.S. illegally as children. Trump ended safeguards against deportation three months ago but has expressed an openness to restoring them.

Meadows said the Freedom Caucus had not taken a final position on whether it will back the short-term bill, but he and several others stopped short of saying they’d oppose it.

Conservative leaders met with top House Republicans and said they were seeking a strategy to reduce Democrats’ budget leverage by quickly approving a full-year budget for the military. It was unclear how Republicans could prevent Senate Democrats from blocking such a move.

The roughly 30-member caucus has been trying to win promises of tight budget curbs and other concessions from leaders in exchange for backing the short-term bill. Without support from many of them, Republicans would need votes from Democrats to push the temporary spending measure through the House, and Democrats have not said what they will do.

Democratic votes for any budget measure will be crucial in the Senate, where Republicans by themselves lack the 60 votes needed to approve the legislation.

___

AP reporter Ken Thomas contributed.