President Donald Trump makes a statement at the White House following reports that U.S. forces attacked Islamic State leader Abu Bakr al-Baghdadi in northern Syria, in Washington, October 27, 2019.

Jim Bourg | Reuters

President Donald Trump signed a short-term spending bill into law Thursday with little time to spare before the government shut down.

The measure funds the government at current levels through Dec. 20. It sets up another potential showdown over spending next month.

The funding extension gives the House and Senate more time to come to a long-term appropriations deal. Democrats and Republicans hope to find a way to keep the government running into next year as President Donald Trump again insists on billions of dollars to fund his proposed border wall.

The Senate easily passed the stopgap spending plan in a 74-20 vote on Thursday. The House approved it with a more narrow 231-192 margin, as most Republicans in the chamber opposed it.

Funding would have lapsed Friday if Trump did not sign the bill into law.

The White House has lamented having to approve short-term spending bills. In a tweet Thursday, Vice President Mike Pence contended Trump "will be force to sign a Continuing Resolution because Congress failed to do its job once again."

Congress already passed a two-year agreement to set budget levels and suspend the U.S. debt ceiling, but lawmakers still need to approve appropriations bills.

This story is developing. Please check back for updates.

Subscribe to CNBC on YouTube.