President Donald Trump has declared a national emergency in an effort to secure resources that could make plans for his long-demanded wall along the U.S.-Mexico border a reality.

On Friday, Trump said he signed the emergency declaration in order to quicken the process of building the controversial wall. Also Friday, the president signed a funding bill that will prevent another government shutdown.

The bill passed both the House and Senate Thursday, a day before the shutdown deadline, and will provide $1.375 billion for 55 miles of border fencing. Trump has long pushed for more than $5 billion to construct 200 miles of barriers, resulting in an impasse that late last year resulted in a 35-day partial shutdown of the federal government.

“It’s a great thing to do,” Trump said during a speech at the White House about the declaration. “Because we have an invasion of drugs, an invasion of gangs, and it’s unacceptable.”

White House press secretary Sarah Sanders said Thursday the emergency was meant “to ensure we stop the national security and humanitarian crisis at the border.”

But what exactly does that mean? Here’s an explainer on Trump’s plan and what powers it gives the president.

What is a national emergency?

Trump is able to enact a national emergency thanks to the National Emergencies Act, which was passed in 1976 and gives the president “greatly enhanced powers” during emergencies — specifically, more than 100 statutory powers that cover a broad range of issues, from agriculture to public contracts, according to the Brennan Center for Justice, a nonpartisan public policy and law institute. The powers Trump may be most interested in, however, would focus on the use of armed forces and military construction projects, according to the center.

While a national emergency adds many options to the president’s arsenal, it doesn’t mean he has complete freedom to do what he wants. Elizabeth Goitein, of the Brennan Center, outlines the process in the January/February edition of the Atlantic:

Aiming to rein in this proliferation, Congress passed the National Emergencies Act in 1976. Under this law, the president still has complete discretion to issue an emergency declaration—but he must specify in the declaration which powers he intends to use, issue public updates if he decides to invoke additional powers, and report to Congress on the government’s emergency-related expenditures every six months. The state of emergency expires after a year unless the president renews it, and the Senate and the House must meet every six months while the emergency is in effect “to consider a vote” on termination.

Why would Trump want to declare a national emergency?

Passing laws through Congress is a lengthy process, and it's become obvious that a clash between a Democratic-ruled House and GOP-majority Senate won't make what he wants easy.

“We can call a national emergency and build it very quickly,” Trump said last month. “But if we can do it through a negotiated process, we are giving that a shot.”

By both signing the bill and declaring a national emergency, Trump hopes to secure the money drawn out in the spending package and combine it with funds from other programs that could result in $8 billion for barriers along the border, according to the New York Times.

How can the declaration be challenged?

The state of emergency could be thrown out by a vote in the House and Senate, which would then need to be approved by the president himself, according to PBS, or a two-thirds vote in each chamber to overrule a veto. House Democrats are already poised to take action.

It’s very likely the battle will reach the courts.

“Because the [National Emergencies Act] and related military construction authorities do not appear to have been employed to construct barriers along the U.S. border, the invocation of such authorities for that purpose would raise a variety of novel legal issues,” according to a report from the Congressional Research Service released last month.

And not just one lawsuit, but many of them with an ultimate decision probably coming out of the Supreme Court, according to the Washington Post.

“Any crisis on our border is of President Trump’s own making,” said Xavier Becerra, the attorney general of California and a likely litigant, according to the publication. “Family separations, child detention, turning our backs on asylum seekers, and more. There is no national emergency. If Trump oversteps his authority and abandons negotiations with Congress by declaring a fabricated national emergency, we won’t only call his bluff, we will do what we must to hold him accountable. No one is above the law.”

When have emergencies been declared in the past?

National emergencies aren’t unheard of.

“They’re declared for all kinds of things,” Kim Lane Scheppele, a professor at Princeton University’s Center for Human Values, told USA Today. “They’re absolutely common, which is why nobody blinks an eye about the whole thing — and then you get a case like this.”

There have been nearly 60 emergencies declared before, according to the Brennan Center for Justice. For example, President George W. Bush declared one after the 9/11 terrorist attack, and in 2009, President Barack Obama declared the swine flu outbreak an emergency. Trump has announced three himself since taking office.