The Senate approved legislation Thursday that would prevent a new government shutdown and provide money for President Trump Donald John TrumpOmar fires back at Trump over rally remarks: 'This is my country' Pelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Trump mocks Biden appearance, mask use ahead of first debate MORE's U.S.-Mexico border wall moments after Senate Majority Leader Mitch McConnell Addison (Mitch) Mitchell McConnellPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Senate GOP aims to confirm Trump court pick by Oct. 29: report Trump argues full Supreme Court needed to settle potential election disputes MORE (R-Ky.) announced that Trump would also sign an emergency declaration over the southern border.

The 83-16 vote in the Senate came after several hours of drama, with increasing chatter about whether Trump would actually sign the deal, which funds a quarter of the government that was poised to run out of funding starting on Saturday.

The bill now heads to the House, which is expected to vote on it later Thursday evening and send it to Trump’s desk for his signature.

ADVERTISEMENT

The vote came as aides and lawmakers remained in the dark throughout Thursday about whether or not Trump would sign the agreement, which was struck by a bipartisan conference committee earlier this week.

McConnell ended that suspense a little after 3 p.m., when he interrupted a Senate floor speech to announce that Trump would sign the border deal but also declare a national emergency.

“I had an opportunity to speak with President Trump and he, I would say to all my colleagues, has indicated he's prepared to sign the bill,” McConnell said. “He also [will] be issuing a national emergency declaration at the same time. I indicated I'm going to support the national emergency declaration.”

The White House also released a statement confirming that Trump "will sign the government funding bill, and as he has stated before, he will also take other executive action — including a national emergency — to ensure we stop the national security and humanitarian crisis at the border."

"The President is once again delivering on his promise to build the wall, protect the border, and secure our great country," White House press secretary Sarah Huckabee Sanders said in the statement.

The legislation would prevent the second partial government shutdown in as many months. The first, which lasted 35 days over December and January, was the longest in U.S. history.

The new legislation would fund roughly a quarter of the federal government through Sept. 30.

In addition to funding for roughly a quarter of the government, the bill includes $1.375 billion for barriers along the U.S.-Mexico border including 55 miles of fencing. That’s below the $5.7 billion Trump requested or the $1.6 billion included in the Senate’s spending measure for the Department of Homeland Security.

Fears that Trump might not sign the bill even as the Senate and House prepared to approve it were widespread on Thursday.

Sen. Chuck Grassley Charles (Chuck) Ernest GrassleyCollins says she will vote 'no' on Supreme Court nominee before election The Hill's Morning Report - Sponsored by Facebook - Trump, GOP allies prepare for SCOTUS nomination this week Gardner signals support for taking up Supreme Court nominee this year MORE (R-Iowa) opened the Senate by asking his colleagues to pray that Trump would sign it.

“Let's all pray that the president will have wisdom to sign the bill so the government doesn’t shut down,” Grassley said.

Republicans emerged from a closed-door caucus lunch largely in the dark about Trump’s intentions.

“I hope that one, we’ll pass the bill in the Senate and then the House with good margin, and then the president will sign it,” said Sen. Richard Shelby Richard Craig ShelbySenate GOP eyes early exit Dems discussing government funding bill into February GOP short of votes on Trump's controversial Fed pick MORE (R-Ala.), who spoke with Trump on Wednesday night.

But the funding bill also sparked backlash from conservatives, some of whom publicly urged Trump not to sign it.

Top conservative pundits bashed the bill on Thursday, sparking fresh questions about if Trump would sign the legislation. Fox News host Laura Ingraham said in a string of tweets that Trump “must not” sign it.

Several Republican senators voted against the funding deal, which was filed around midnight Wednesday: GOP Sens. Mike Braun Michael BraunPessimism grows as hopes fade for coronavirus deal McConnell shores up GOP support for coronavirus package Patient Protection Pledge offers price transparency MORE (Ind.), Tom Cotton Tom Bryant CottonGOP brushes back charges of hypocrisy in Supreme Court fight Trump uses bin Laden raid to attack Biden Battle lines drawn on precedent in Supreme Court fight MORE (Ark.), Ted Cruz Rafael (Ted) Edward CruzTrump argues full Supreme Court needed to settle potential election disputes Press: Notorious RBG vs Notorious GOP The Hill's Morning Report - Sponsored by Facebook - Washington on edge amid SCOTUS vacancy MORE (Texas), James Inhofe (Okla.), 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), Rand Paul Randal (Rand) Howard PaulSecond GOP senator to quarantine after exposure to coronavirus GOP senator to quarantine after coronavirus exposure The Hill's Morning Report - Sponsored by National Industries for the Blind - Trump seeks to flip 'Rage' narrative; Dems block COVID-19 bill MORE (Ky.), Ben Sasse Benjamin (Ben) Eric SasseGovernment watchdog recommends creation of White House cyber director position Chamber of Commerce endorses McSally for reelection Ben Sasse is mistaken with idea for the election of senators in America MORE (Neb.), Tim Scott Timothy (Tim) Eugene ScottAuthor Ryan Girdusky: RNC worked best when highlighting 'regular people' as opposed to 'standard Republicans' Now is the time to renew our focus on students and their futures GOP lobbyists pleasantly surprised by Republican convention MORE (S.C.) and Pat Toomey Patrick (Pat) Joseph ToomeyAppeals court rules NSA's bulk phone data collection illegal Dunford withdraws from consideration to chair coronavirus oversight panel GOP senators push for quick, partial reopening of economy MORE (Pa.).

The bill also split several 2020 White House contenders serving in the Senate, with Democratic Sens. Cory Booker Cory Anthony BookerBipartisan praise pours in after Ginsburg's death DHS opens probe into allegations at Georgia ICE facility Democratic lawmakers call for an investigation into allegations of medical neglect at Georgia ICE facility MORE (N.J.), Kirsten Gillibrand Kirsten GillibrandSunday shows preview: Justice Ginsburg dies, sparking partisan battle over vacancy before election Suburban moms are going to decide the 2020 election Jon Stewart urges Congress to help veterans exposed to burn pits MORE (N.Y.), Kamala Harris Kamala HarrisButtigieg stands in as Pence for Harris's debate practice First presidential debate to cover coronavirus, Supreme Court Harris joins women's voter mobilization event also featuring Pelosi, Gloria Steinem, Jane Fonda MORE (Calif.) and Elizabeth Warren Elizabeth WarrenHarris joins women's voter mobilization event also featuring Pelosi, Gloria Steinem, Jane Fonda Judd Gregg: The Kamala threat — the Californiaization of America GOP set to release controversial Biden report MORE (Mass.) voting against it.

—Jordan Fabian and Juliegrace Brufke contributed