The House of Representatives on Thursday night approved the compromise border security package to avert another government shutdown that was passed overwhelmingly by the Senate earlier in the day -- even as another showdown looms over the White House's plan to declare a national emergency to access more wall funding.

A senior administration official tells Fox News that President Trump will sign the bill Friday morning, and use executive action to reallocate approximately $8 billion additional dollars from different federal agencies in order to fully fund construction on his planned southern border wall. Trump will also declare a national emergency.

The compromise legislation passed in the Senate by a 83-16 vote, and secured House passage by a similarly veto-proof 300-128 vote later with mixed support from Democrats and Republicans in the evening. The bill headed to Trump's desk late Thursday, following a so-called "enrollment ceremony" in which House Speaker Nancy Pelosi, D-Calif., formally prepared it.

"300 votes on the floor," Pelosi told Fox News during the ceremony. "It was quite a remarkable show."

Added House Majority Whip Jim Clyburn, D-S.C.: "We were bargaining for 70 [GOP] votes, and we came up with 87."

The legislation provides almost $1.4 billion for new barriers along the nation's southern boundary with Mexico. That's less than the $1.6 billion for border security in a bipartisan Senate bill that Trump spurned months ago, and far short of the $5.7 billion Trump has long requested. It's enough for building just 55 miles of barricades, not the 200-plus miles he'd sought.

Notably, the word "wall," the heart of many a chant at Trump campaign events and his rallies as president, is absent from the compromise's 1,768-page legislative and descriptive language. "Barriers" and "fencing" are the nouns of choice.

The compromise, which took bargainers three weeks to strike, provides additional funding for 5,000 more beds that Immigration and Customs Enforcement (ICE) can use to house illegal immigrants. But in an attempt to pressure the agency to detain fewer illegal immigrants, Democrats ensured that the bill did not include funding for the 2,000 additional ICE agents requested by the Trump administration, or the 750 Border Patrol agents that were also sought.

Provisions providing some support for ICE angered some Democrats. Several progressive freshmen, including Rep. Alexandria Ocasio-Cortez, D-N.Y., and Minnesota Rep. Ilhan Omar, voted against the bill.

OMAR SEEKS TO CLARIFY COMMENTS CALLING FOR 'NOT ONE DOLLAR' FOR DHS

Ocasio-Cortez told Fox News before the vote that she saw little reason for either side to celebrate.

"I will be voting NO on this disastrous 1169 page bill." — Texas Republican Rep. Chip Roy

"I don’t think this deal is a victory for anybody," Ocasio-Cortez said. "It’s a Republican bill ... just to keep the government funded."

And, Texas Republican Rep. Chip Roy, who succeeded retired longtime GOP Rep. Lamar Smith this year, called the legislation ineffective and wasteful.

"I will be voting NO on this disastrous 1169 page bill," Roy said. "It increases spending, fails to secure the border, empowers cartels to traffick children to 'sponsors' in the US receiving amnesty, punts congressional duty to the Presidency, & may well undermine any emergency declaration."

But National Republican Congressional Committee (NRCC) head Tom Emmer said in a statement that, under the circumstances, the bill was the best available option.

"I applaud President Trump and Republican leaders in Congress for securing the best deal anyone could hope to get with these socialist Democrats running the House of Representatives," Emmer said. “We could have gotten a much better deal if Democrats weren’t so blinded by their quest for open borders and their hatred of ICE that they were willing to jeopardize the safety of our law enforcement personnel on the southern border."

Before the Senate vote, White House Press Secretary Sarah Sanders said the president would sign the compromise bill and would take executive action to unlock other federal dollars for the wall.

The move likely would involve "reprogramming" funds previously allocated by Congress, which ordinarily requires the sign-off of the House and Senate Appropriations Committees and DHS Appropriations Subcommittees. Article I of the Constitution provides that Congress wields the ultimate power of the purse, and an end-run around Congress could trigger legal challenges.

However, courts generally have been reluctant to weigh in on legal disputes between Congress and the White House under the political question doctrine. And it was not immediately clear who would have standing to sue over any emergency declaration. To have standing to sue, a plaintiff must generally have personally suffered some legally cognizable injury, beyond a general political disagreement with the White House.

Pelosi stopped short of vowing that congressional Democrats would file a lawsuit in a press conference earlier Thursday.

“President 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," Sanders said in a statement. "The president is once again delivering on his promise to build the wall, protect the border, and secure our great country.”

Under existing law and procedure, Pelosi has the ability to pass legislation to overturn any emergency declaration by Trump, and that measure could pass the GOP-held Senate as well -- though Trump could veto it. At that point, two-thirds of both the House and Senate would be needed to terminate Trump's emergency declaration.

There were a total of 30 national emergency declarations in effect as of February 1, 2019, according to a tabulation prepared by the Congressional Research Service, predominately concerning sanctions related to Iran, Zimbabwe, Sudan, and Yemen.

One of the emergency declarations currently in effect, entitled "Blocking Iranian Government Property," dates back to the administration of President Jimmy Carter.

TRUMP 'NOT HAPPY' WITH BORDER DEAL, BUT WANTS TO AVOID ANOTHER SHUTDOWN

However, none of those 30 previously declared national emergencies involved the White House spending money that Congress had appropriated specifically. While it was not clear late Thursday exactly how the White House would use the emergency declaration, Trump administration officials previously had instructed the Army Corps of Engineers to look into the possibility of tapping into unspent disaster relief funds allocated by Congress in 2018.

Congressional aides say there is $21 billion in military construction money that could potentially be used by Trump if he declares a national emergency. But according to the law the money has to be used in support of U.S. armed forces, they say.

The Defense Department declined to provide details on available money.

In a joint statement Thursday afternoon, Senate Minority Leader Chuck Schumer, D-N.Y., and Pelosi condemned any potential emergency declaration in no uncertain terms.

“Declaring a national emergency would be a lawless act, a gross abuse of the power of the presidency and a desperate attempt to distract from the fact that President Trump broke his core promise to have Mexico pay for his wall," Pelosi and Schumer said, adding that "Congress will defend our constitutional authorities.”

2020 Democratic presidential contenders and prospective candidates were split on the funding compromise reached by the House and Senate. Minnesota Sen. Amy Klobuchar and Vermont Independent Sen. Bernie Sanders, who is expected to join the Democratic primary soon, backed the bill. Ohio Sen. Sherrod Brown, another Democrat weighing a presidential run, also voted in favor.

KLOBUCHAR DOWNPLAYS GREEN NEW DEAL IN FOX INTERVIEW, CALLS IT 'ASPIRATIONAL' -- AND SUGGESTS SHE MIGHT'VE TOSSED A BINDER

White House hopefuls who opposed the legislation, meanwhile, included California Sen. Kamala Harris, New Jersey Sen. Cory Booker, Massachusetts Sen. Elizabeth Warren and New York Sen. Kirsten Gillibrand.

Democrats were more united, however, in opposing a potential emergency declaration. The National Emergencies Act grants the president broad authority to declare emergencies, and several federal laws could then clear a path for the White House to move ahead with building a wall.

One statute, 33 U.S. Code § 2293 - "Reprogramming during national emergencies," permits the president to "apply the resources of the Department of the Army’s civil works program, including funds, personnel, and equipment, to construct or assist in the construction, operation, maintenance, and repair of authorized civil works, military construction, and civil defense projects that are essential to the national defense."

Another law, 10 U.S. Code § 2808 - "Construction authority in the event of a declaration of war or national emergency," permits the secretary of defense, in a presidentially declared emergency, to use "funds that have been appropriated for military construction" for the purpose of undertaking "military construction projects."

WHAT IS A 'NATIONAL EMERGENCY,' EXACTLY?

Democrats repeatedly have called the border wall nothing more than a political stunt that they would never agree to fund, while Republicans have pointed to what they've called a "crisis" at the border. Central Americans are increasingly entering the United States illegally in groups of at least 100 people in rugged, remote stretches of the Mexican border, officials said last week upon releasing January figures that showed total arrests falling for a second straight month.

A group of 325 Central American migrants surrendered to agents late last week near Lukeville, Ariz., according to Customs and Border Protection. Migrants told authorities that buses and trucks dropped them off throughout the night on a nearby Mexican highway running parallel to the border and they entered the U.S. together to wait for agents to find them. There were nearly 150 children, including 32 who were traveling alone.

The Border Patrol has encountered groups of at least 100 people 60 times since Oct. 1, compared to 13 during the entire 2018 fiscal year and two in the 2017 fiscal year, officials said. Many are in the desolate New Mexico Bootheel and Arizona deserts.

It is unclear what's driving the sudden uptick of large groups in remote areas, but families, many of them Central American asylum seekers, make up a large and growing percentage of arrests across the border.

CLICK TO GET THE FOX NEWS APP

U.S. authorities arrested or stopped people for immigration violations 58,207 times in January, down 4 percent from 60,779 in December but up 62 percent from 35,905 in January 2018. It was the second straight monthly decline, though arrests typically fall from December to January.

Families and children traveling alone accounted for 33,861 of those encounters, or nearly 6 of every 10 stopped at official crossings or arrested for entering the country illegally between crossings, mostly from Guatemala, El Salvador and Honduras. That's a dramatic change from several years ago, when most people who crossed illegally were single Mexican adults.

Lawmakers had until 11:59 p.m. Friday to get the agreement through both houses of Congress and signed by Trump before several Cabinet-level departments shut down and hundreds of thousands of federal workers were furloughed in what would be the second partial government shutdown this year.

Fox News' Alex Pappas, Chad Pergram, Kristin Brown, Jon Decker and The Associated Press contributed to this report.