Despite claims to the contrary, the Posse Comitatus Act does not prohibit President Trump from sending military forces to the U.S.-Mexico border. Just as President Trump has the authority to declare a state of national emergency, he also has the authority to send troops to our southern border under certain circumstances.

The Posse Comitatus Act, 18 U.S. Code, Section 1385, was first passed in 1878 to resolve concerns that the federal military was being used to enforce domestic laws in former Confederate states. Under its original terms, the Posse Comitatus Act prohibited the use of the Army to act as a posse comitatus (which means to act as domestic law enforcement) “except in cases and under circumstances expressly authorized by the Constitution or Act of Congress.”

After World War II, Congress included the Air Force as subject to the Act, but strangely it did not include the Navy or Marine Corps, although a subsequent Department of Defense Regulation applies it to them. And as a maritime law enforcement agency, the Coast Guard is not subject to the Posse Comitatus Act.

As part of his plan to secure America’s borders, President Trump has proposed sending U.S. military personnel to the southern border. More recently, the President considered declaring a state of national emergency.

While some have claimed that President Trump may lack the legal authority to declared a state of national emergency, others claim that sending troops to the border violates Posse Comitatus. Recently, Representative Ted Lieu (D-CA) declared it would be “illegal” for President Trump to declare a national emergency and send troops to the southern border, stating “it would violate the Posse Comitatus Act.” Congressman Lieu, who claims to have “studied this issue” as a military attorney, is incorrect, and to understand why, it’s important to understand how both issues are connected.

President Trump clearly has the authority to declare a state of national emergency. Less clear is is whether a declared state of emergency qualifies as one of the circumstances expressly authorized by the Constitution or Act of Congress under which Posse Comitatus applies. Resolving that question through months, or years, of litigation is probably less-than desirable for a President. Fortunately, Congress has already taken specific actions that obviate the need for litigation.

Under the Fiscal Year 2007 National Defense Authorization Act, Congress granted the President the authority to mobilize the military “restore public order and enforce the laws of the United States” under a number of circumstances, to include “a condition that opposes or obstructs the execution of the laws of the United States.” Congress also authorized the Secretary of Defense to, upon request from the Secretary of Homeland Security, assist in domestic law enforcement efforts to prevent terrorists, illegal drugs, and illegal aliens from entering the United States.

In other words, the Posse Comitatus Act’s own exception can be triggered under the conditions outlined in the 2007 NDAA. Thus, it is not an absolute prohibition on the domestic use of military forces. Indeed, in 2005, Congress issued a Joint Resolution stating that:

[B]y its express terms, the Posse Comitatus Act is not a complete barrier to the use of the Armed Forces for a range of domestic purposes, including law enforcement functions, when the use of the Armed Forces is authorized by Act of Congress or the President determines that the use of the Armed Forces is required to fulfill the President’s obligations under the Constitution to respond promptly in time of war, insurrection, or other serious emergency.

Were President Trump to actually send troops to the southern border, it would not be unprecedented. In 2006, President George W. Bush deployed roughly 6,000 troops to the border to support domestic law enforcement activities. And in 2010, President Obama took similar action. Notably, while those actions might have been unpopular, no one seriously questioned whether Presidents Bush and Obama violated the Posse Comitatus Act.

Whether President Trump should deploy federal troops to the southern border is a question best left to policy experts. But there should be no question that President Trump certainly can deploy those troops, should he decide to do so.

Mike Berry is a leading expert in military law. He spent over seven years on active duty as a lawyer in the Marine Corps, including time spent as an instructor at the U.S. Naval Academy. Berry has represented military clients in high-profile cases involving war crimes, homicide, and espionage, among others.