After battling for weeks over funding for a border wall, overseeing the longest government shutdown in US history, and finally signing on to a deal to fund the government, President Donald Trump has declared a national emergency over a contrived crisis at the US-Mexico border.

On Friday, Trump invoked his power to declare a national emergency in a unilateral effort to make progress on the border wall Congress has thus far denied him. He initially demanded $5 billion for the construction of about 200 miles of barrier at the border, and Democrats in Congress have repeatedly refused to go anywhere near that figure. He got about $1.3 billion for border fencing in the deal he finally agreed to, a far cry from the desired amount. So he’s going with a national emergency to get more.

“We’re going to confront the national security crisis on our southern border, and we’re going to do it, one way or another, we have to do it,” he said in a speech at the White House Rose Garden on Friday.

Trump will try to cobble together funds from a number of areas and redirect them toward border wall construction. White House officials ahead of the announcement on Friday said he would redirect about $600 million from the Treasury Forfeiture Fund, an account funded by money seized by the US government; $2.5 billion from the Department of Defense’s counter-drug activities; and $3.6 billion from other military construction accounts. Trump won’t try to take anything from disaster relief.

“I didn’t need to do this,” Trump said on Friday. “But I’d rather do it much faster.”

That the president has finally decided to declare an emergency isn’t entirely surprising — he has been wavering on the idea for weeks.

So why declare a national emergency in addition to the spending deal? The short answer is that Trump doesn’t want to admit he lost. He’s already getting less for border fencing than was in the original spending bill he refused to sign in December — and caused a 35-day government shutdown over — so he’s looking to executive action instead.

There has been some debate about whether Trump can indeed declare an emergency at the border considering there isn’t really one, and the answer, at least initially, seems to be that he can.

Senate Majority Leader Mitch McConnell said on the Senate floor on Thursday that he would support the emergency declaration.

A 1976 law gives the president authority to declare national emergencies within certain constraints. Whether there’s an actual emergency isn’t one of them.

Many presidents have declared national emergencies, including George W. Bush after 9/11 and Barack Obama during the swine flu outbreak in 2009. Before Trump’s declaration, there were 31 national emergencies active in the United States — his marks the 32nd.

In recent history, presidents have declared national emergencies under the National Emergencies Act of 1976, which lets them issue emergency declarations under specific constraints. Basically, Trump can only use specific powers Congress has already codified in law, and he has to say which powers he’s using.

The 1976 law was actually meant to rein in presidential power and put some guardrails around how presidents declared national emergencies. It does not define what counts as an emergency and what doesn’t.

“He has broad leeway to declare an emergency, frankly, whether one exists or not,” Elizabeth Goitein, a co-director of the Liberty and National Security Program at the Brennan Center for Justice, who recently wrote an in-depth explainer of presidential emergency powers in the Atlantic, recently told me.

Trump on Friday defended his decision by noting that other presidents have declared emergencies in the past. “It’s been signed many times before,” and there has “rarely been a problem,” he said. Trump said his predecessors had declared national emergencies for “far less important things in some cases.”

There is no emergency

Despite Trump’s fearmongering about an influx of dangerous illegal immigrants and terrorists at the US-Mexico border, there is actually no such crisis. There’s been no significant shift in the situation in recent days or weeks that suddenly renders urgent action necessary.

Moreover, Trump had two years of an entirely Republican-controlled Congress to do something about immigration. Now that there’s a Democratic-controlled House, he’s suddenly saying there’s an emergency.

This isn’t the first time Trump has invented an immigration crisis when convenient — ahead of the midterms, he warned about a dire threat from migrant caravans, only to essentially drop the issue after the elections. There has been a rise in asylum seekers to the US, but seeking asylum is legal, and that’s not what Trump is focusing on here. Congress won’t pay for his border wall, he thinks he’ll lose his base if he abandons it, and so he’s manufacturing panic and going to any length possible to get it done.

Trump will likely face challenges in court. He could also see pushback from Congress, which could pass a joint resolution to override the declaration. But Trump would have to sign the resolution, so to override it, Congress would need a two-thirds majority in both houses.

In other words, the emergency declaration is here for now.

The news moves fast. Catch up at the end of the day: Subscribe to Today, Explained, Vox’s daily news podcast, or sign up for our evening email newsletter, Vox Sentences.