The Senate on Thursday easily cleared a two-week stopgap funding bill, one day before the deadline to avoid a government shutdown.

Senators voted 81-14 on the legislation, which cleared the House earlier in the day.

The bill now heads to the White House, where President TrumpDonald John TrumpDems flip Wisconsin state Senate seat Sessions: 'We should be like Canada' in how we take in immigrants GOP rep: 'Sheet metal and garbage' everywhere in Haiti MORE is expected to sign it.

Six Republicans, seven Democrats and Sen. Bernie SandersBernard (Bernie) SandersMellman: On Political Authenticity (Part 2) Former Sanders campaign manager: Don't expect email list to be shared with DNC Adult film star: Trump and Stormy Daniels invited me to 'hang out' MORE (I-Vt.) voted against the legislation. 

Congress had until the end of Friday to pass a bill or spark a government shutdown — something GOP leadership has been adamant they would not let happen while they control the levers of power in Washington.

Lawmakers now face another deadline on Dec. 22, setting up a funding showdown just three days before Christmas.

Top GOP senators urged their colleagues to support the legislation despite grumbling among some in the caucus about the impact a continuing resolution has on military spending.

“We need this legislation to give Congress and the administration additional time to agree on responsible spending levels for the current fiscal year and beyond. ... I hope the Dec. 22 backstop will facilitate an agreement that will enable the Congress to provide funding for important national security and domestic priorities,” Sen. Thad CochranWilliam (Thad) Thad CochranTrump's chief agricultural negotiator will fight for American farmers Rep. Cummings hospitalized, wife suspends gubernatorial campaign Medical cannabis community must join together and resist any action taken against us MORE (R-Miss.), chairman of the Appropriations Committee, said shortly before the Thursday evening vote.

Majority Leader Mitch McConnellAddison (Mitch) Mitchell McConnellSessions: 'We should be like Canada' in how we take in immigrants NSA spying program overcomes key Senate hurdle Overnight Finance: Lawmakers see shutdown odds rising | Trump calls for looser rules for bank loans | Consumer bureau moves to revise payday lending rule | Trump warns China on trade deficit MORE (R-Ky.) said the stopgap measure would “provide us with the time we need to complete discussions on a long-term solution.”

But Sen. John McCainJohn Sidney McCainMcCain rips Trump for attacks on press NSA spying program overcomes key Senate hurdle Meghan McCain says her father regrets opposition to MLK Day MORE (R-Ariz.), the chairman of the Armed Services Committee, said it was "unacceptable" that Congress was passing the stopgap bill.

"I have implored Congress and the White House to negotiate a bipartisan budget agreement, because without one, the military will be funded under a Continuing Resolution at the Budget Control Act levels," he said.

Senate Republicans can’t pass a government funding bill on their own, and needed consent from Democrats to speed up debate of the legislation to meet Friday’s deadline.

Democratic leadership remained tight-lipped throughout the week about if they would support a continuing resolution as they looked for leverage in negotiations on a final, year-end spending package. 

“I don’t know. I think this is likely to pass,” Sen. Dick DurbinRichard (Dick) Joseph DurbinMcCarthy: ‘No deadline on DACA’ Ex-Sheriff David Clarke: Trump only one who 'cares about black American citizens' DHS chief takes heat over Trump furor MORE (D-Ill.) told reporters in the lead up to Thursday’s vote.

Negotiators are hoping to get a deal on the budget caps before the Dec. 22 deadline. 
 
An agreement would likely allow lawmakers to pass another continuing resolution into January and use the time to craft a "omnibus" spending bill that would fund the government through the rest of the 2018 fiscal year. 
 
If lawmakers aren't able to get a deal on the budget, sequestration is set to start in mid-January, which will spark automatic spending cuts. 
 
McConnell, Minority Leader Charles SchumerCharles (Chuck) Ellis SchumerDemocrats will need to explain if they shut government down over illegal immigration White House: Trump remarks didn't derail shutdown talks Schumer defends Durbin after GOP senator questions account of Trump meeting MORE (D-N.Y.), Speaker Paul RyanPaul Davis RyanGOP leaders pitch children's health funding in plan to avert shutdown Lawmakers see shutdown’s odds rising Fix what we’ve got and make Medicare right this year MORE (R-Wis.) and House Minority Leader Nancy PelosiNancy Patricia D'Alesandro PelosiDemocrats search for 51st net neutrality vote Hoyer suggests Dems won't support spending bill without DACA fix Trump’s first year in office was the year of the woman MORE (D-Calif.) met with Trump and Vice President Pence at the White House on Thursday to discuss the looming year-end fight. 
 
McConnell told reporters after the meeting that they did not reach an agreement, with Schumer and Pelosi offering a similar take in a joint statement. 
 
“We had a productive conversation on a wide variety of issues. Nothing specific has been agreed to, but discussions continue," they said. 
 
Democrats want an equal increase in defense and nondefense spending, as well as an extension of the Children's Health Insurance Program (CHIP) and a legislative fix for the Deferred Action for Childhood Arrivals (DACA) program. 
 
The Trump administration announced earlier this year that it was nixing DACA, which allows immigrants brought into the country as children to live and work. The program will expire in March. 
Trump's move has sparked a legislative showdown in the Senate.
 
Democrats, who say the issue needs to be dealt with by the end of the year, want Republicans to pass a deal that links the Development, Relief, and Education for Alien Minors (DREAM) Act with border security. 
 
Republicans, and the White House, counter that an immigration deal will not be included in the funding bill. 

Sen. James LankfordJames Paul LankfordA year into Trump's presidency, the media is still ignorant of his plan for a wall Trump's 's---hole' remark sparks bipartisan backlash GOP senator: Trump’s reported ‘s---hole’ comments ‘disappointing’ MORE (R-Okla.), who introduced legislation that would include a path to citizenship, said on Thursday that lawmakers didn't have time to reach an agreement by the end of the year. 

"There's too many outstanding issues. ... There's not enough time to build the coalitions to get a result by the end of the year," he said. 

In addition to Sanders and McCain, the senators who voted against the stopgap funding bill were Cory BookerCory Anthony BookerDHS chief takes heat over Trump furor Booker to Nielsen: 'Your silence and your amnesia is complicity' Homeland Security secretary grilled over Trump comments MORE (D-N.J.), Ted CruzRafael (Ted) Edward CruzWith religious liberty memo, Trump made America free to be faithful again Interstate compacts aren't the right way to fix occupational licensing laws Texas Dem: ‘I don’t know what to believe’ about what Trump wants for wall MORE (R-Texas), Joni ErnstJoni Kay ErnstIowa voters laugh after GOP senator says Trump is standing up for Norway Dems face hard choice for State of the Union response Family caregivers need a voice in our political debate MORE (R-Iowa), Kirsten GillibrandKirsten Elizabeth GillibrandTrump thinks he could easily beat Sanders in 2020 match-up: report Listen: EMILY’s List upbeat about Dem House in '19 Desperate Democrats shouldn't settle for Oprah MORE (D-N.Y.), Kamala HarrisKamala Devi HarrisDHS chief takes heat over Trump furor NSA spying program overcomes key Senate hurdle Democrats will need to explain if they shut government down over illegal immigration MORE (D-Calif.), Mazie HironoMazie Keiko HironoDem senator: Trump 'made clear' that he wants 'white people to come to our country' Hawaii false alarm sparks panic, confusion Dem senator working to ensure Hawaii false alarm ‘never happens again’ MORE (D-Hawaii), Mike LeeMichael (Mike) Shumway LeeNSA spying program overcomes key Senate hurdle With religious liberty memo, Trump made America free to be faithful again This week: Time running out for Congress to avoid shutdown MORE (R-Utah), Ed MarkeyEdward (Ed) John MarkeyDemocrats search for 51st net neutrality vote Overnight Regulation: Dems claim 50 votes in Senate to block net neutrality repeal | Consumer bureau takes first step to revising payday lending rule | Trump wants to loosen rules on bank loans | Pentagon, FDA to speed up military drug approvals Dems say they have 50 votes in Senate to overrule net neutrality repeal MORE (D-Mass.), John McCain (R-Ariz.), Jeff MerkleyJeffrey (Jeff) Alan MerkleyEarly tax bill reality very different than Democratic rhetoric Senate GOP seeks to change rules for Trump picks Dem senators tear into Trump: Tax bill 'a very big Christmas gift from Trump to himself' MORE (D-Ore.), Mike RoundsMarion (Mike) Michael RoundsOvernight Tech: Regulators to look at trading in bitcoin futures | Computer chip flaws present new security problem | Zuckerberg vows to improve Facebook in 2018 Senate sex trafficking bill wins 60 co-sponsors Five key decisions for the GOP on health care MORE (R-S.D.), Ben SasseBenjamin (Ben) Eric SasseOvernight Cybersecurity: Bipartisan bill aims to deter election interference | Russian hackers target Senate | House Intel panel subpoenas Bannon | DHS giving 'active defense' cyber tools to private sector Interstate compacts aren't the right way to fix occupational licensing laws GOP senator demands briefing from Sessions after reports of Russian hackers targeting Senate MORE (R-Neb.) and Elizabeth WarrenElizabeth Ann WarrenWarren: Trump is a 'racist bully' Poll: Oprah would outperform Warren, Harris against Trump in California Democrats continue to dismiss positive impacts of tax reform MORE (D-Mass.).

- This story was updated at 6:31 p.m.