The current budget standoff could end in a few different ways, which would determine the future of any potential lawsuits. Congress could make a deal with Trump, pass a budget, and get his signature on the legislation. Congress could also pass a budget without Trump, but then it would have to override his veto, which would require the unlikely cooperation of Senate Republicans. As long as Congress is still trying to work out a deal, courts have little role to play: “They can’t just say, ‘Hey, open the government!’” said Susan Bloch, a law professor at Georgetown University.

Alternatively, Trump could follow through on a suggestion he has been publicly toying with for several weeks: He could declare the alleged crisis at the border a national emergency and use that as a premise to direct money from existing budgets to the wall. This is the scenario in which a lawsuit by House Democrats would become relevant: They could claim the president was violating the House’s authority to make appropriations under Article I of the Constitution.

This kind of move does not have much precedent. “Courts are loath to be pulled into these types of political standoffs,” said Jonathan Turley, a law professor at George Washington University. “You have two parties who are playing a rather dangerous game of chicken.” In 2014, however, with Turley’s help, the GOP-held House of Representatives sued Obama for using government money to subsidize health-care costs under the Affordable Care Act without an appropriation from Congress. Obama, Republicans argued, had violated the House’s rights under Article I.

In theory, judges try to avoid situations where they appear to be refereeing partisan fights, and no fight could be more bitter than one in which members of one branch of the federal government sue the head of another. Despite this norm of reluctance, a district-court judge sided with Republicans in House v. Burwell.

[Read: What the president could do if he declares a state of emergency]

The big question in the case was whether the House had standing, or the right to bring this case against the president. Rosemary Collyer, a D.C. district-court judge, said yes. Although the substance of the Obamacare case was eventually resolved through a settlement agreement, and Collyer’s decision wouldn’t be binding on future judges, it showed that legislators have a chance of success in suing the president—or, at least, in using a lawsuit to slow down the president. This is the most important question, said Saikrishna Prakash, a law professor at the University of Virginia: “If they sued, would they be able to get an injunction telling him not to spend the money?”

In effect, this would be a way of getting around the work of politics: Unable to negotiate a deal themselves, the Democrats would be looking to the courts to stop Trump. There’s a reason legal action looks attractive in a standoff such as this, said Prakash. “Of the three branches, the courts are held in highest esteem. Having a court say that you’re right or you’re wrong does seem to end the discussion,” he said. “It’s not uncommon for politicians to think the court’s job is to sort these things out.”