Congressional Democrats have a way to potentially stop President Trump’s declaration of a national emergency without going to court, and they’re planning to use it.

As part of the National Emergencies Act of 1976, the law that details the president’s ability to make emergency declarations, there’s also a legislative check that’s given to Congress. After the president declares an emergency, Congress can pass a resolution that terminates it. House Democrats, led by Rep. Joaquín Castro (D-TX), have introduced this very measure, and the House is set to vote on it on Tuesday.

Members of Congress all swear an oath to support and defend the Constitution. On Tuesday, the House will vote on @JoaquinCastrotx’s legislation to defend the separation of powers following @realDonaldTrump’s decision to ignore the bounds of the law with his emergency declaration. — Nancy Pelosi (@SpeakerPelosi) February 22, 2019

Senate Minority Leader Chuck Schumer has also said lawmakers plan to introduce a companion bill in the upper chamber.

Democrats argue that Trump’s declaration of a national emergency — something he did to try to obtain funding for his border wall after those funds had already been authorized for other projects — completely bypasses Congress and its ability to allocate funding, as designated by the Constitution.

Presidents have historically had a wide berth when it comes to using the powers they are granted during national emergencies. It’s relatively unprecedented, however, for the president to explicitly use one to get money for a project after Congress has declined to fund that exact endeavor.

Pelosi emphasized this point in a letter she sent to colleagues on Wednesday, noting that the emergency declaration “undermines the separation of powers and Congress’s power of the purse, a power exclusively reserved by the text of the Constitution the first branch of government, the Legislative branch, a branch co-equal to the Executive.”

Castro’s measure has already picked 222 co-sponsors in the House, according to a tweet he posted.

We have 222 cosponsors to terminate President Trump’s national emergency declaration to build his border wall. #FakeTrumpEmergency pic.twitter.com/guCB4PQlK2 — Joaquin Castro (@JoaquinCastrotx) February 22, 2019

Once the Democratic-controlled House passes it, as it’s expected to do this week, the resolution heads to the Senate, where its fate is a bit more dicey. The Senate is also set to vote on the measure quickly, but it’s uncertain if it will garner the votes it needs. Because House Democrats are introducing the measure as a “privileged resolution,” the Senate would “be required by law to vote on the measure within 18 days,” CNN’s Michael Warren points out.

What remains up in the air is whether enough Republicans will join with the 47-member Democratic caucus (or even if all the Democrats will stay united, since some broke in favor of Trump’s version of the spending bill earlier this month) to reach the 51-vote threshold it needs to advance. Given the outcry in response to the president’s declaration from some Republicans, it’s possible there are at least four Republican senators who are willing to confront him directly on this issue.

Senate Republicans who have expressed concerns with the national emergency declaration, including Rand Paul (R-KY) and Marco Rubio (R-FL), could be among those who band with the Democrats to push the resolution forward. Sens. Susan Collins (R-ME) and Thom Tillis (R-NC) have already said they would be open to voting for a resolution blocking the emergency declaration. It remains to be seen just how many other Republicans will sign on.

There is also one other big catch with the legislative check on the national emergency, though: It’s a resolution that the president still has to sign.

In the case that the House and Senate both pass it, Trump would be put in the position of signing a bill that overturns his own national emergency declaration — which he doesn’t appear on track to do, according to CNN’s Betsy Klein. The White House on Tuesday formally announced that advisers would recommend that Trump veto the resolution in its current form.

White House officially issues veto threat on resolution to terminate Pres. Trump’s National Emergency declaration, per @betsy_klein pic.twitter.com/NasvVvU328 — Phil Mattingly (@Phil_Mattingly) February 26, 2019

There is a decent chance that 51 senators could support the resolution, but it’s unlikely the Senate would have a veto-proof majority.

It’s worth noting that this is far from the first time Trump has issued a veto threat, but it would be a real test of whether he’s actually willing to go through with a veto, which would be his first ever. (As evidenced by previous spending fights, there have been numerous instances when Trump has ultimately caved despite previously threatening a veto.)

Democrats could take the fight to the courts

If the resolution fails, Democrats could jump in on the growing number of lawsuits that are already being levied against the Trump administration over the national emergency.

Last week, 16 states, led by California, filed a suit against the Trump administration, arguing that it was hurting the states by diverting funds that would have otherwise gone to key projects. Groups including the American Civil Liberties Union and the Sierra Club have filed suits of their own, and landowners along the southern border are expected to mount a challenge as well.

In the same vein as the case made by congressional Democrats, these suits argue that what Trump is doing is simply unconstitutional and a unilateral move aimed at going around the legislative branch. Democrats could ultimately join one of these suits or file their own.

Pelosi and Senate Minority Leader Chuck Schumer have said that they intend to consider any possible means of blocking this national emergency. “The Congress will defend our constitutional authorities in the Congress, in the Courts, and in the public, using every remedy available,” they said in a statement.

Pending the outcome of the congressional resolution, the courts could be next.

Interestingly, Democrats would potentially be able to use a 2014 suit House Republicans brought against the Obama administration as a helpful precedent. At the time, Republicans argued that the Obama administration’s attempt to pay out subsidies to different health insurers under the Affordable Care Act was unconstitutional, because Congress hadn’t allocated those funds. A district court judge affirmed that this concern offered grounds for Republicans to sue.

House Democrats could capitalize on this logic to make their case against the Trump administration this time around. For now, they’re going after the emergency by using their legislative tools first.