"I'm going to be signing a national emergency, and it's been signed many times before, by many presidents. It's rarely been a problem ... nobody cared," the president said during unscripted remarks Friday morning in the White House Rose Garden. White House press secretary Sarah Huckabee Sanders then shared an image that she said showed Trump signing the declaration.

The president signed a spending and border security plan into law to keep the government running through Sept. 30, with only hours to spare before parts of the government shut down Saturday. Before he did so, Trump also declared a national emergency to repurpose funds from other parts of the government to build his proposed border wall without congressional approval.

"I think we will be very successful in court," the president contended, in response to concerns about his authority to declare a national emergency.

Trump braced for a coming legal battle. "I expect to be sued" after declaring an emergency, he said. Trump added that challenges could go to the Supreme Court, where he hopes to get a "fair shake."

In his remarks Friday, Trump justified his move by claiming the U.S. faces an "invasion" — though border crossings are at the lowest levels seen in decades. He argued the U.S. needs barriers to hold off traffickers of people and drugs, even as he commended his administration for stopping so-called caravans of migrants.

Several Republicans hesitated to line up behind Trump even as the party's leaders backed up the declaration.

"The President's emergency declaration, if unchecked, would fundamentally alter the balance of powers, inconsistent with our Founders' vision. ... The President is not above the law. The Congress cannot let the President shred the Constitution," they said.

Already, some Democrats have threatened legislation to block it. In a joint written statement, House Speaker Nancy Pelosi, D-Calif., and Senate Minority Leader Chuck Schumer, D-N.Y., said they "will defend our constitutional authorities in the Congress, in the Courts and in the public, using every remedy available."

Dealt another political blow by Congress over the spending bill, the president has repeatedly argued he has the authority to reallocate money without the approval of the legislative branch. The emergency declaration, the administration claims, would permit the president to divert funds from other agencies, primarily the Department of Defense, to be used for the border project.

The president's comments in recent weeks as he threatened an emergency declaration could hurt his legal case. He repeatedly framed it as a choice, rather than a necessity, raising questions about how urgent it really is. On Friday, he claimed: "I could do the wall over a longer period of time. I didn't need to do this [national emergency]. But I would rather do it much faster."

Trump had pushed for lawmakers to approve $5.7 billion to build his proposed border wall. Instead, the divided Congress passed only $1.375 billion to construct new bollard fencing on 55 miles of the U.S.-Mexico border. By declaring a national emergency, and taking other executive action, the White House hopes to create a pool of $8 billion to use for barriers.

The president faces significant opposition to his action. The emergency declaration, which was criticized by Democrats and Republicans alike when Trump first threatened it, is likely to bring swift legal and legislative challenges . Already, it has sparked a fierce debate over executive authority, as critics argue Trump has manufactured a crisis to fulfill a campaign promise that was thwarted by Congress.

President Donald Trump speaks during an event in the Rose Garden at the White House to declare a national emergency in order to build a wall along the southern border, Friday, Feb. 15, 2019, in Washington.

Officials and groups quickly announced lawsuits Friday. California Attorney General Xavier Becerra said he plans to take legal action against the declaration "very soon with sister states." The American Civil Liberties Union also plans to file a lawsuit.

Speaking to reporters Friday morning, acting White House chief of staff Mick Mulvaney said the president intends to create an $8 billion pot of money for wall construction. Congress set aside $1.375 billion of that in the Department of Homeland Security funding bill. Another $600 million would come from Treasury Department drug forfeiture funds. The Department of Defense would provide the rest, in the form of $2.5 billion from the military's fund for counter-narcotics activities, and $3.6 billion reprogrammed from the military construction budget.

"What's not on that list is taking away disaster relief money from places like Texas and Puerto Rico," Mulvaney said, who sought to put to rest earlier speculation that the administration might use funds set aside for disasters to build the wall.

Mulvaney also insisted that the president's use of national emergency powers, codified in a 1976 bill passed by Congress, did not create a precedent future presidents could use to pay for their own policy priorities without congressional appropriations.

It was not entirely clear why this action wouldn't set a precedent for the future, however. At one point, Mulvaney seemed to suggest that it was because this action was legal, and those of a Democratic president wold not be.

The current legislation contains strict geographic restrictions on where new portions of wall can be built, but a senior administration official said these only apply to the $1.375 billion from Congress.

The official also explained that only one of the four funding sources, the military construction funds, specifically required the declaration of a national emergency, while the rest did not. The official said presidents had activated these emergency restricted funds twice before: Once in 1990, to fund Operation Desert Storm to liberate Kuwait following Iraqi invasion, and the second time in November 2001, to fund the American military campaign in Afghanistan in response to the 9/11 attacks.

The White House is currently going through a filtering process to ensure that any funds taken from the military would not affect operational readiness or active duty troops, the official said. The accounts tapped to build the wall this year would be refilled with funds in the 2020 fiscal budget, which the administration aims to finalize this spring, the person added.

The administration's ultimate goal is to build 234 miles of wall, but the official acknowledged that the precise outcome and processes will be "a little bit of a mix and match, because different pots [of funding] have different restrictions on how they can be used."

The official also emphasized that any new portions of wall would be made of steel bollard, saying that both Democrats and Republicans had agreed to this type of barrier months ago. "There's no fight over what's going to be built, it's going to be a bollard wall," the official said.

Trump's wall demand led to a record 35-day partial government shutdown during December and January. This time around, he chose to keep the government open, but risked an even bigger gambit.

Backlash from Democrats came down quickly when Trump announced his intent to declare a national emergency on Thursday.

"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 in a statement Thursday. They added: "This is not an emergency, and the president's fearmongering doesn't make it one."

Another senator with a key role in overseeing Defense appropriations said he would fight Trump's move to pull from the military construction budget. In a tweet Thursday night, Sen. Brian Schatz, D-Hawaii, called it "an abdication of our obligation to responsibly fund the military" and said he "will fight this in every way that [he] can."

"Whether it's dry docks or clinics or hangers (sic) or runways, there is not 3.5B to remove without dire consequences," Schatz, the ranking member on the Senate Appropriations Committee's Military Construction and Veterans Affairs Subcommittee, wrote in a follow-up tweet Friday morning.

The top Republicans in Congress offered their support for an emergency declaration. On Thursday, Senate Majority Leader Mitch McConnell, R-Ky., and House Minority Leader Kevin McCarthy, R-Calif., both said they backed the president's move.

Not all Republicans were comfortable with it. GOP senators including Chuck Grassley of Iowa, Marco Rubio of Florida and John Cornyn of Texas have argued a declaration would set a bad precedent as Trump threatened to take the step in recent weeks.

In a statement Thursday, Rubio said that "no crisis justifies violating the Constitution," adding that he is "skeptical" whether he can back the declaration. Sen. Rand Paul, R-Ky., also tweeted that "extraconstitutional executive actions are wrong, no matter which party does them."

Congressional Democrats are gearing up to fight the emergency declaration. Several representatives committed to backing a resolution of disapproval, which Congress can pass within 15 days of the declaration.

If the Democratic-held House approves the measure, it would pressure Republicans in the GOP-held Senate, who by law would have to take it up. Trump could veto the plan if lawmakers could not muster enough votes to overcome his opposition.

Read the full text of the national emergency declaration, as released by the White House:

DECLARING A NATIONAL EMERGENCY CONCERNING THE SOUTHERN BORDER OF THE UNITED STATES - - - - - - - BY THE PRESIDENT OF THE UNITED STATES OF AMERICA A PROCLAMATION The current situation at the southern border presents a border security and humanitarian crisis that threatens core national security interests and constitutes a national emergency. The southern border is a major entry point for criminals, gang members, and illicit narcotics. The problem of large-scale unlawful migration through the southern border is long-standing, and despite the executive branch's exercise of existing statutory authorities, the situation has worsened in certain respects in recent years. In particular, recent years have seen sharp increases in the number of family units entering and seeking entry to the United States and an inability to provide detention space for many of these aliens while their removal proceedings are pending. If not detained, such aliens are often released into the country and are often difficult to remove from the United States because they fail to appear for hearings, do not comply with orders of removal, or are otherwise difficult to locate. In response to the directive in my April 4, 2018, memorandum and subsequent requests for support by the Secretary of Homeland Security, the Department of Defense has provided support and resources to the Department of Homeland Security at the southern border. Because of the gravity of the current emergency situation, it is necessary for the Armed Forces to provide additional support to address the crisis. NOW, THEREFORE, I, DONALD J. TRUMP, by the authority vested in me by the Constitution and the laws of the United States of America, including sections 201 and 301 of the National Emergencies Act (50 U.S.C. 1601 et seq.), hereby declare that a national emergency exists at the southern border of the United States, and that section 12302 of title 10, United States Code, is invoked and made available, according to its terms, to the Secretaries of the military departments concerned, subject to the direction of the Secretary of Defense in the case of the Secretaries of the Army, Navy, and Air Force. To provide additional authority to the Department of Defense to support the Federal Government's response to the emergency at the southern border, I hereby declare that this emergency requires use of the Armed Forces and, in accordance with section 301 of the National Emergencies Act (50 U.S.C. 1631), that the construction authority provided in section 2808 of title 10, United States Code, is invoked and made available, according to its terms, to the Secretary of Defense and, at the discretion of the Secretary of Defense, to the Secretaries of the military departments. I hereby direct as follows: Section 1. The Secretary of Defense, or the Secretary of each relevant military department, as appropriate and consistent with applicable law, shall order as many units or members of the Ready Reserve to active duty as the Secretary concerned, in the Secretary's discretion, determines to be appropriate to assist and support the activities of the Secretary of Homeland Security at the southern border. Sec. 2. The Secretary of Defense, the Secretary of the Interior, the Secretary of Homeland Security, and, subject to the discretion of the Secretary of Defense, the Secretaries of the military departments, shall take all appropriate actions, consistent with applicable law, to use or support the use of the authorities herein invoked, including, if necessary, the transfer and acceptance of jurisdiction over border lands. Sec. 3. This proclamation is not intended to, and does not, create any right or benefit, substantive or procedural, enforceable at law or in equity by any party against the United States, its departments, agencies, or entities, its officers, employees, or agents, or any other person. IN WITNESS WHEREOF, I have hereunto set my hand this fifteenth day of February, in the year of our Lord two thousand nineteen, and of the Independence of the United States of America the two hundred and forty-third. DONALD J. TRUMP

Subscribe to CNBC on YouTube.