Donald Trump’s threat to declare a national emergency at the US border with Mexico is being taken so seriously inside Congress that a powerful committee is preparing a bipartisan challenge to the move.

The Democrat-led House Armed Services Committee, which oversees funding and operations of the Defense Department, has been united across party lines in its opposition.

If Trump declares a national emergency, the first step is to see “how he writes it, and how he does it,” said Donald Norcross, a New Jersey Democrat on the committee chaired by Adam Smith of Washington state. “I am very confident there will be a legal challenge” to any declaration, Norcross told Quartz. “There needs to be.”

Mac Thornberry, the committee’s top Republican, said this week that he opposes using an emergency declaration to fund the border wall Trump demands: “We ought to fund border security needs on their own and not be taking it from other accounts.” A lawsuit is from the committee would challenge Trump’s right to use defense funds on projects not yet authorized by Congress, given that the proposed wall—and the border situation more generally—has no real link to the military.

The Defense Department has no role to play in any decision, a Pentagon spokesman told Quartz: “The White House is responsible for any declaration of a national emergency.”

Any declaration of emergency will “have to go to a court challenge,” said Democratic representative Pramila Jayapal of Washington state, co-chair of the progressive caucus and a member of the budget and judiciary committees. Emergency powers have only been invoked in the past in cases that involve US interests in war-torn regions or to combat terrorism. To put the border issue on the same plane, Jayapal said, “does a real disservice to real emergency situations.”

During his visit to McAllen, Texas yesterday (Jan. 10), Trump said that “if for any reason we don’t get this going” —referring to the $5.7 billion he says he needs for the wall — “I will declare a national emergency.”

His words were given extra clout after Lindsey Graham, the South Carolina Republican senator, told Trump to “build the wall now.”

What happens in a national emergency?

A 2007 Congressional Research Service report lays out the powers a president can invoke in declaring an emergency, which might include the right to:

seize property, organize and control the means of production, seize commodities, assign military forces abroad, institute martial law, seize and control all transportation and communication, regulate the operation of private enterprise, restrict travel, and, in a variety of ways, control the lives of United States citizens.

Bypassing ordinary rules can allow the federal government to respond quickly and more efficiently to a crisis. Trump would need to to spell out which laws give him the rights to do so. The House and Senate are then able to review the declaration every six months, to make sure that it’s still necessary, and can pass a joint resolution to bring it to an end. Congress has largely ignored this requirement, leaving 31 national emergencies declared since 1976 to remain in effect, according to CNN.

The New York Times (paywall) suggests that if Trump wants to use emergency powers to build a border wall, he might redirect Army resources and troops toward constructing “authorized civil works, military construction and civil defense projects that are essential to the national defense” under a specific statute relating to military reprogramming during national emergencies. Trump could also choose to employ another similar law which would allow him to redirect funds for military construction to other projects “not otherwise authorized by law that are necessary to support such use of the armed forces.”

That kind of move is exactly what the House Armed Services Committee is likely to object to.

Checking presidential overreach

When president Gerald Ford signed the National Emergencies Act in 1976, the bill sought specifically to give Congress a strong role in restricting the reach of the added powers given to the chief executive. It has only been somewhat successful.

The act gave Congress the right to end national emergencies—providing both houses could agree by simple majority. Speaking to the Times in 1976, senator Charles Mathias described the bill as a “safeguard” for Americans “against abuse of presidential power.”

Even though he signed the 1976 bill, Ford disliked this particular limit on presidential powers, and challenged it as unconstitutional. In 1983, the Supreme Court agreed and the act was amended (pdf) two years later. Since 1985, any congressional vote to stop the emergency can be vetoed by the president—and overridden only if there is a two-thirds majority in both chambers.

Trump would be in a strong position here: It’s doubtful that both the House and the Republican-led Senate would agree to end an emergency by the necessary two-thirds majority. With 235 seats, Democrats control just 54% of the House, but Norcross and other Democrats told Quartz there was growing support among Republicans to challenge a Trump declaration. In the Senate, where the GOP holds 53 of 100 seats, moderate Republicans would have to join Democrats in opposition.