WASHINGTON – Efforts to pass a short-term spending bill to avoid a government shutdown collapsed Thursday when President Donald Trump said he would not sign a Senate-approved measure because it doesn’t include enough money for a border wall.

“I’ve made my position very clear: Any measure that funds the government must include border security," Trump said.

Trump spoke during a signing ceremony for an unrelated farm bill a few hours after he told House Republican leaders at an emergency Oval Office meeting that he would not sign the Senate funding proposal.

Hard-line conservatives in the House Freedom Caucus complained that the legislation does not include $5 billion Trump demands for a wall along the nation’s southern border.

The spending measure would punt a decision about border wall funding until next year, when Democrats will return to power in the House of Representatives, making it unlikely that Trump would get the money he wants.

House Speaker Paul Ryan, R-Wis., said after the White House meeting that Republicans “want to keep the government open, but we also want to see an agreement that protects the border. We have very serious concerns about securing our border.”

The bill, which would fund nine federal departments and several smaller agencies at their current levels through Feb. 8, cleared the Senate late Wednesday on a voice vote and was likely to win approval in the House.

Funding to keep the government open will lapse at midnight Friday unless Congress and the White House reach a deal to extend it.

At the White House ceremony, Trump expressed hope that Congress could come up with an acceptable bill. “We’ll see what we can do, but hopefully that will all come together," he said.

He downplayed the use of the term "wall," using the phrases "physical barriers" and "steel slats." But he also said, "Walls work, whether we like it or not."

More:A look at what services will – and won't – be interrupted if there is a government shutdown

Earlier Thursday, Trump tweeted about his demands for border wall money but did not specifically comment on the Senate's short-term bill to keep the government in business through early February.

“When I begrudgingly signed the Omnibus Bill, I was promised the Wall and Border Security by leadership. Would be done by end of year (NOW). It didn’t happen! We foolishly fight for Border Security for other countries - but not for our beloved U.S.A. Not good!” he wrote.

After Trump's meeting with House Republicans, White House spokeswoman Sarah Sanders issued a statement that "not surprisingly, they all feel strongly about Border Security – stopping the flow of drugs, stopping human trafficking, and stopping terrorism."

"We protect nations all over the world, but Democrats are unwilling to protect our nation," she said. "We urgently need funding for border security and that includes a wall."

Conservatives in the House Freedom Caucus urged Trump to fight for border wall funding and to veto any spending measure that doesn’t include the money. Freedom Caucus members Mark Meadows of North Carolina and Jim Jordan of Ohio were among the Republicans at the White House meeting with Trump.

The spending bill could be the last chance to win the funding, Freedom Caucus members argued, because the House will fall under Democratic control in January and Rep. Nancy Pelosi, D-Calif., is likely to become speaker.

“We’ve been telling the American public that we were going to fight. They have no reason to believe us now,” said Rep. Paul Gosar, R-Ariz., a Freedom Caucus member.

Republican congressional leaders said the short-term spending measure is the only way to avoid a government shutdown heading into the holidays.

"We don’t want to end this year the way we began it, with another government shutdown,” said Senate Majority Leader Mitch McConnell, R-Ky., who pushed the temporary bill.

Gosar countered that a government shutdown over the holidays may actually show “we don’t need all this big government.”

Freedom Caucus member Scott Perry, R-Pa., said, “We made a promise to the American people to secure the border. This is our last chance. Nancy Pelosi will not do this.”

Pelosi and Senate Minority Leader Charles Schumer, D-N.Y., said Democrats have no intention of approving money for a border wall.

"In terms of wall funding, that’s a nonstarter," Pelosi said.

Conservatives are "angry and mad, so they pound their fist on the table. ... Their anger will result in a Trump shutdown, but not a Trump wall," Schumer said.

Unless the funding is extended, nine departments and several smaller agencies will run out of money and will be forced to close their doors. As many as 800,000 federal employees would be placed on furlough or would have to work without pay.

Congress is scrambling to pass a short-term spending bill because lawmakers still haven’t passed seven of the 12 appropriations bills needed to fund the government for the fiscal year that began Oct. 1.

The seven remaining bills would fund nine departments – Agriculture, Commerce, Justice, Homeland Security, Interior, State, Transportation, Treasury and Housing and Urban Development – as well as several smaller agencies. Those are the departments and agencies that would be affected by a government shutdown.

House Appropriations Committee Chairman Rodney Frelinghuysen, R-N.J., said that although he would have preferred to pass all seven of the bills, “there is still a broad ideological divide when it comes to our borders.”

A short-term bill would give the White House and lawmakers time “to come to a responsible compromise that puts the security of our nation first," he said.

Contributing: Eliza Collins

More:Americans' message to Washington on the looming shutdown: Don't

More:Another government shutdown? Congress has until Dec. 21 to pass a spending bill to keep the lights on

More:The Ghost of Shutdowns Past haunts latest talks to keep the federal government open