President Donald Trump just used his first veto, and he did it save his recent national emergency, something he declared to obtain funding for a southern border wall.

On Friday, he vetoed a congressional resolution that would have terminated the national emergency and barred him from authorizing certain military funds for border wall construction.

Trump had declared an emergency in February after signing legislation that ended the longest government shutdown in history. And he did so in order to obtain more money for the wall since Congress declined to allocate it. Citing the authority granted to him by the emergency, Trump intends to reauthorize roughly $8 billion.

Congress this week passed a measure to cancel this emergency, even though lawmakers knew Trump would veto it.

Just over two dozen Republicans joined Democrats across the House and Senate on this resolution, with many arguing that it bypassed Congress’s constitutionally granted “power of the purse.” The resolution required Trump’s signature to go into effect, however. And since the resolution wasn’t passed with a veto-proof majority (two-thirds of both chambers), it is now effectively dead.

But that doesn’t mean Trump’s border wall national emergency is safe. Many legal experts say the very existence of a bipartisan majority blocking the emergency could give it a lot more support in court.

This is the first time that Congress has ever voted to terminate a president’s national emergency, and also the first time Trump has followed through on his threats to veto a bill. In many previous funding fights, he’s said he would veto different spending bills, only to ultimately sign them.

The fight over the emergency now heads to the courts

The next stop for the fight against the national emergency will take place in courts across the country as organizations including the American Civil Liberties Union and more than 16 states pursue lawsuits challenging Trump’s declaration.

One of the arguments these suits are making is that Trump is attempting to obtain funds via the national emergency that Congress has already declined to give him, rendering his actions unconstitutional. Since Congress holds the power to authorize federal spending, as designated by the Constitution, Trump’s efforts could be seen as going around the legislative branch.

The congressional vote against the resolution could be used in court to demonstrate just how much opposition there is from the legislative branch to Trump’s actions, legal experts told Vox. It could also be used to show that the emergency Trump is claiming is anything but, since Congress has now actively sought to terminate it.

“When this issue gets to the courts, Congress’s view that no emergency exists might well affect how aggressively the courts review the president’s arguments to the contrary,” said Richard Pildes, a constitutional law professor at NYU.

The National Emergencies Act of 1976 gives presidents a wide berth when it comes to determining what an emergency is, which could provide Trump’s declaration the cover it needs to prevail in court.

Congress’s vote on Thursday, however, could speak to questions about its constitutionality and strengthen challengers’ cases on this front.