A stop sign is seen in front of the international border fence in Nogales, Arizona, March 9, 2016. Credit: Astrid Galvan | AP

WASHINGTON — A groundbreaking Obamacare case from 2015 could provide the legal underpinnings House Democrats need to sue President Donald Trump if he moves forward with building a border wall.

It was in House v. Burwell that a federal judge said — for the first time — that Congress may sue the executive branch over spending money it hasn’t appropriated. That case had to do with health insurance subsidies, and was brought against the Obama administration by the House when Republicans controlled it. The lawsuit ultimately ended in a settlement after Trump took office.

That ruling probably has opened the door to a lawsuit from the now Democratic-led House if Trump follows through on his threats to declare a national emergency and start building a border wall without congressional consent. And that remains a distinct possibility: Negotiations to reopen the government remained stalled over the weekend and the president appeared to dig in to his position, despite urging from even Sen. Lindsey Graham, R-South Carolina, to cut a deal with Democrats.

“With Trump determined to deliver on his signature campaign promise of building a border wall and Democrats standing firm against what they view as an immoral and ineffective solution to illegal immigration, there is no end in sight to the dysfunction,” Washington Post reporters Bob Costa, Josh Dawsey, Philip Rucker and Seung Min Kim wrote.

Things are so gridlocked that House Democrats are already considering what they’d do if Trump declares a national emergency to redirect public money toward a border wall. The issue isn’t whether the president can declare an emergency — he has broad powers to do so — but rather what leeway that might give him to fund his pet project.

“There’s no question he’s allowed to claim there is an emergency,” Sam Berger, a senior adviser at the liberal Center for American Progress who served as a lawyer at the White House Office of Management and Budget in the Obama administration, said. “What’s illegal is when he claims that emergency lets him spend money in a way that Congress hasn’t authorized.”

That’s exactly the contention House Republicans made about the Obama administration when they argued that then-Health and Human Services Secretary Sylvia Mathews Burwell was using dollars unappropriated by Congress to fund what are known as “cost-sharing reductions,” or CSRs. That money was provided under the Affordable Care Act as a way of helping the lowest-income Obamacare customers finance extra costs associated with their health plans beyond the monthly premium, such as deductibles or copays.

When the House first filed its lawsuit in November 2014, it was unclear whether the lower chamber even had authority to sue the executive branch. But U.S. District Judge Rosemary Collyer charted new legal territory when she ruled the House has standing to file such a lawsuit if it believes the executive branch has spent money it didn’t approve.

“Neither the president nor his officers can authorize appropriations; the assent of the House of Representatives is required before any public moneys are spent,” Collyer wrote in September 2015.

The lawyer who represented Republicans in the case said House Democrats probably would have standing to sue the Trump administration over building a wall — even though he called a such a potential challenge “ill-conceived.”

“I believe the House has legislative standing in this matter but that does not mean they have a good case to bring,” Jonathan Turley wrote in an email over the weekend.

“Frankly, my greatest concern is that the House leadership does not fritter away this precedent in an ill-conceived challenge,” he added. “They need to consider the possibility that they could not only lose on the merits but undermine one of the most important rulings on legislative standing in history.”

But liberal legal experts contend that should Trump use unappropriated dollars to pay for a wall, it would be a much clearer breach of Congress’s power of the purse than when the Obama administration funded the CSRs.

Even if Congress hadn’t set aside funding specifically for those subsidies, it had at least authorized them as part of the ACA. But in this case, Congress hasn’t passed a law creating a border wall — let alone set aside money to pay for it.

To Berger, it’s a clear distinction.

“There was money there and we were fighting over what we were authorized to do with that money,” Berger said. “Trump’s saying ‘I want money for the wall’ and Congress is saying no and he’s saying ‘Well then I’m going to ignore you and do it anyway.’”