Washington (CNN) The Senate passed a stop-gap spending bill on Wednesday night in an effort to keep the government funded and prevent a partial shutdown at the end of the week.

A shutdown hasn't been averted just yet: The measure will still need to be approved by the House of Representatives and signed by President Donald Trump before it can take effect.

But the Senate's passage of the short-term measure brings Washington one step closer to staving off a shutdown of some key federal agencies, set to expire at midnight on Friday, just days before Christmas.

The Senate worked late into the night on Wednesday to pass the measure, which had appeared to have hit a snag earlier in the day over a push to advance public lands legislation.

McConnell introduced the measure earlier on Wednesday to fund the remaining parts of the government through February 8, 2019.

McConnell's proposal has the backing of the top congressional Democratic leaders Nancy Pelosi and Chuck Schumer, and top congressional Republicans have indicated they are optimistic that the President would sign the measure.

Senate Majority Whip John Cornyn, the current no. 2 highest-ranking Senate Republican, predicted on Wednesday that Trump would sign it.

"He will sign a clean CR," Cornyn told CNN.

The Senate passed the measure by voice vote.

As senators gathered on the floor ahead of the vote, a group of Senate Democrats, including Sen. Tim Kaine of Virginia, Sen. Chris Coons of Delaware and outgoing Sen. Heidi Heitkamp of North Dakota, began singing Christmas carols.

At one point, Republican Sen. Jeff Flake, who was presiding over the session, jokingly said that Rudolph had voted "present," a comment that met with laughter inside the chamber.

For several hours ahead of the vote, the bill was held up over a push to advance public lands legislation. And after final passage, several senators took to the floor to vent their frustrations over that issue.

Republican Sen. Lisa Murkowski expressed disappointment, saying "this is something that I wish we had been able to resolve." But the package is now on track to come up for a vote in the next Congress.

Schumer told reporters that he and McConnell made a commitment to supporters to bring the lands' package up as one of the first votes in January.

The next step for the stop-gap funding effort is the House of Representatives where it is likely to pass despite some conservative opposition.

Pelosi, the House Democratic leader who is poised to reclaim the speaker's gavel in the new Congress, said Wednesday afternoon that she supported the measure.

"This is a missed opportunity to pass full-year funding bills now," Pelosi said in a statement. "However, Democrats will be ready to fully, responsibly fund our government in January, and we will support this continuing resolution."

Senate Democratic Leader Chuck Schumer said during a speech on the Senate floor, "Thankfully, President Trump appears to have backed down from his position for billions in direct appropriations for a border wall."

Republicans and Democrats on Capitol Hill have made clear they don't want a shutdown, but had been at an impasse over the President's demand for $5 billion in funding for his long-promised wall at the US-Mexico border.

Democrats have made clear that figure is a non-starter for them and any spending bill would need at least some Democratic votes to pass in the Senate.

Of course, no spending measure is final until the President signs it.

But on Tuesday, the White House appeared to step away from the brink of a shutdown.

White House press secretary Sarah Sanders said Tuesday morning during an interview with Fox News that, "We have other ways that we can get to that $5 billion (for a border wall)."

Members of the conservative House Freedom Caucus and other conservative allies of the President plan gave brief speeches on the House floor Wednesday night, however, urging Trump not to abandon his quest for border wall funding.

They included: Mark Meadows of North Carolina, Jim Jordan of Ohio, Paul Gosar of Arizona, Steve Pearce of New Mexico, Jody Hice of Georgia, Ralph Norman of South Carolina, Andy Biggs of Arizona and Morgan Griffith of Virginia.

Despite opposition from the Freedom Caucus, however, the House should still have the votes to still pass the continuing resolution, assuming most, if not all, Democrats support it, since it has Pelosi's blessing.

But even as members of the Freedom Caucus are poised to urge Trump not to abandon his quest for border wall funding, White House officials say it's likely the President will do just that -- and sign a short-term spending bill to avert a partial government shutdown.

The President has been unusually quiet about the issue on Wednesday, holding his tongue as some conservative commentators and lawmakers blast him for abandoning his commitment.

But two White House aides said the President likely has no choice but to sign a temporary funding measure to keep the government open until February 8. The aides say the White House is intentionally not signaling what Trump will do, but there does not appear to be talk inside the West Wing of blocking it.

White House counselor Kellyanne Conway hinted earlier that Trump is leaning this way when she told reporters at the White House the President will "take a look at" the continuing resolution, though she attempted to frame any punt as something other than a concession from the White House.

All this comes a week after the President said he'd be "proud" to shut down the government, so delaying the funding fight until Democrats retake the House next year is a fairly clear concession -- and a risky one. Although Republicans clearly don't have the votes to support his request.

This story has been updated with additional developments Wednesday.