The Senate approved a stopgap spending bill on Thursday night, ensuring there will be no government shutdown days before Christmas and essentially completing a frenetic year on Capitol Hill — and the first under President Trump Donald John TrumpBiden on Trump's refusal to commit to peaceful transfer of power: 'What country are we in?' Romney: 'Unthinkable and unacceptable' to not commit to peaceful transition of power Two Louisville police officers shot amid Breonna Taylor grand jury protests MORE.

Senators voted 66-32 to approve the roughly four-week continuing resolution (CR), which funds the government through Jan. 19, hours after it passed the House.

Seventeen Democrats voted for the measure, including several up for reelection next year in states carried by Trump such as Sens. Joe Donnelly Joseph (Joe) Simon DonnellyHarris faces pivotal moment with Supreme Court battle Trump meets with potential Supreme Court pick Amy Coney Barrett at White House Names to watch as Trump picks Ginsburg replacement on Supreme Court MORE (Ind.), Claire McCaskill Claire Conner McCaskillMomentum growing among Republicans for Supreme Court vote before Election Day Democratic-linked group runs ads in Kansas GOP Senate primary Trump mocked for low attendance at rally MORE (Mo.) and Joe Manchin Joseph (Joe) ManchinManchin defends Supreme Court candidate Barrett: 'It's awful to bring in religion' The Hill's Morning Report - Sponsored by Facebook - Trump, GOP allies prepare for SCOTUS nomination this week Trump meets with potential Supreme Court pick Amy Coney Barrett at White House MORE (W.Va.).

But leadership, including Minority Leader Charles Schumer Chuck SchumerCruz blocks amended resolution honoring Ginsburg over language about her dying wish Senate Democrats introduce legislation to probe politicization of pandemic response Schumer interrupted during live briefing by heckler: 'Stop lying to the people' MORE (D-N.Y.), as well as many of the party's potential 2020 contenders, opposed the bill.

Two Republicans, Mike Lee Michael (Mike) Shumway LeeMcConnell shores up GOP support for coronavirus package McConnell tries to unify GOP Davis: The Hall of Shame for GOP senators who remain silent on Donald Trump MORE (Utah) and Rand Paul Randal (Rand) Howard PaulRand Paul says he can't judge 'guilt or innocence' in Breonna Taylor case Overnight Health Care: Health officials tell public to trust in science | Despair at CDC under Trump influence | A new vaccine phase 3 trial starts Health officials tell public to trust in science MORE (Ky.), bucked their party and voted "no."

ADVERTISEMENT

The vote concludes a successful week for Republicans, who on Wednesday finished work on a sweeping tax-cut bill that marked the first major legislative win for Trump.

There were some hiccups along the way with the spending bill, but GOP leaders shepherded the legislation through both chambers on Thursday in part by arguing that it did not make sense to step on the party's successful message on taxes.

Defense hawks had pressed for more funding for the Pentagon. They wanted a deal that increased the spending ceilings for defense, and that would prevent automatic spending cuts scheduled to start at the end of next month without a new measure for the year.

Meanwhile, a coalition of progressive Democrats bucked the bill because lawmakers failed to get a deal on the Deferred Action for Childhood Arrivals (DACA) program by the end of the year.

Democrats lined up on the Senate floor ahead of the vote to demand that Congress pass the Development, Relief and Education for Alien Minors (DREAM) Act.

"Congress could show some courage and protect dreamers by passing a clean DREAM Act. We have waited too long already. ... So my question to Sen. [Mitch] McConnell [R-Ky.] is this: What are you waiting for?" asked Sen. Elizabeth Warren Elizabeth WarrenDimon: Wealth tax 'almost impossible to do' CNN's Don Lemon: 'Blow up the entire system' remark taken out of context Democrats shoot down talk of expanding Supreme Court MORE (D-Mass.), referring to the Senate majority leader.

Members of the Congressional Hispanic Caucus (CHC) met with Schumer on Thursday afternoon to urge him to take a harder line in the immigration fight.

But Democratic leadership remained tight-lipped about if they would force a shutdown in the hours leading up to the Senate’s vote.

“We’re not going to address any of those things until we see what the House does,” Schumer told reporters during a press conference on Thursday.

Unlike in the House, where the stopgap bill passed with only Republican votes, GOP leadership needed the support of at least eight Democrats to get the 60 votes needed to overcome procedural hurdles. Speeding up the continuing resolution also required the agreement of every senator.

Preventing the shutdown will send GOP lawmakers and Trump off on their holiday breaks with a successful conclusion to a difficult year in which they struggled on legislation to repeal and replace ObamaCare. Bickering between Trump and members of the Senate GOP conference was also common.

Still, Republicans will return in January to what could be a difficult set of challenges.

They will have to agree to legislation to keep the government open again before Jan. 19, and also face battles over the DACA program and two health-care bills that the White House and McConnell had promised to move in exchange for Sen. Susan Collins Susan Margaret CollinsClub for Growth to spend million in ads for Trump Supreme Court nominee Maryland's GOP governor says Republicans shouldn't rush SCOTUS vote before election The Hill's Morning Report - Sponsored by Facebook - GOP closes ranks to fill SCOTUS vacancy by November MORE's support on the tax-cut bill.

The Maine Republican didn't get what was promised to her in December, but will be looking for results in January.

Passage of the continuing resolution comes after Senate Republicans were largely stuck in limbo as they waited for their House counterparts to agree on a bill that could pass the Senate.

Initially, Republicans were expected to add two bills aimed at fixing ObamaCare, sought by Collins, into the legislation once it reached the Senate. But they dropped that plan after it became clear that it couldn’t pass the House and as lawmakers were scrambling to get on the same page with a shutdown looming.

Asked on Thursday if they had the votes to pass the stopgap bill, Sen. John Cornyn John CornynThe Hill's Campaign Report: GOP set to ask SCOTUS to limit mail-in voting Liberal super PAC launches ads targeting vulnerable GOP senators over SCOTUS fight Senate GOP faces pivotal moment on pick for Supreme Court MORE (R-Texas) fired back: “Does the House have the votes to pass the CR?”

The president also lashed out at House Democrats in a tweet earlier Thursday, saying they were trying to overshadow the GOP tax bill by forcing a shutdown.

“House Democrats want a SHUTDOWN for the holidays in order to distract from the very popular, just passed, Tax Cuts. House Republicans, don’t let this happen. Pass the C.R. TODAY and keep our Government OPEN!” Trump wrote.

The funding bill also includes a short-term extension of the Children’s Health Insurance Program (CHIP), some spending “anomalies” for defense, a waiver for the pay-as-you-go budgetary rules so the GOP tax bill doesn’t trigger Medicare cuts and an extension of a controversial surveillance program.

The National Security Agency’s (NSA) warrantless surveillance program, which was set to expire on Dec. 31, allows the government to collect emails and text messages sent by foreign spies, terrorists and other foreign targets overseas. One section of the law, Section 702, has drawn criticism from privacy advocates because of the potential for U.S. citizens' communications to be swept up in the surveillance.

Congress has offered competing versions of legislation to extend and reform the program, but still needs to work out the differences between the bills.

And a bipartisan group of privacy hawks in the Senate, as well as the far-right House Freedom Caucus, warned that they would oppose including a long-term extension in the continuing resolution.

“Congress should not vote on any long-term reauthorization of Section 702 until both the House and Senate have fully debated meaningful reforms in 2018,” Paul and Lee said in a joint statement with Sens. Ron Wyden Ronald (Ron) Lee WydenDemocrats call for declassifying election threats after briefing by Trump officials Read Democrats' report countering Republicans' Biden investigation Top GOP senators say Hunter Biden's work 'cast a shadow' over Obama Ukraine policy MORE (D-Ore.) and Patrick Leahy Patrick Joseph LeahyDemocrats shoot down talk of expanding Supreme Court Battle over timing complicates Democratic shutdown strategy Hillicon Valley: Russia 'amplifying' concerns around mail-in voting to undermine election | Facebook and Twitter take steps to limit Trump remarks on voting | Facebook to block political ads ahead of election MORE (D-Vt.).

Meanwhile, Paul warned earlier Thursday that he would force a roll call vote on the funding bill because it included a waiver to raise the pay-go rules. But he failed to strip the waiver out of the legislation in a 91-8 vote.

“Calling all conservatives, libertarians, and anyone who believes in limited government: call your legislatures and say don’t exceed the budget caps,” Paul said in a tweet ahead of the vote.

Updated: 8:49 p.m.