A Texas National Guard soldier scans the Mexican side of the U.S.-Mexico border on September 11, 2014. Photo by John Moore/Getty Images.

President Trump recently announced that “we’re going to be guarding our border with the military” until a border wall between the U.S.-Mexico border can be completed. That completion date remains uncertain in light of so many questions governing the wall’s funding and construction. The president has apparently discussed the military’s movement to the border with his top national security advisors to include Defense Secretary Jim Mattis. It appears that Trump will release a proclamation directing the Department of Defense and the Department of Homeland Security to work with governors to deploy National Guard troops to the southwest border to assist the Border Patrol in combating illegal immigration. Nevertheless, questions remain: What parts of the military will be used?; Who is paying for this? What is the legal authority and what will they be doing? I want to highlight four key initial takeaways to focus your attention on the core legal issues as a “militarized border” implementation plan develops. While it is too simplistic to state that the “president can or can’t do this” – he faces enormous legal challenges and restrictions that will likely thwart his aspirations.

First and foremost, if the president orders federal active-duty military personnel to provide direct support to law enforcement or operate as the functional equivalent of a domestic law enforcement agency on the border, the 1878 Posse Comitatus Act (PCA) applies, which prohibits such activity. In its present form, the law states:

Whoever, except in cases and under circumstances authorized by the Constitution or Act of Congress, willfully uses any part of the Army or the Air Force as a posse comitatus or otherwise to execute the laws shall be fined under this title or imprisoned not more than two years, or both.

So the PCA prevents members of the regular Army and Air Force (so-called “Title 10” forces) from being used in a law enforcement capacity to “execute the laws.” Absent from the text is any reference to the Navy or Marines, but their ability to participate in law enforcement matters is prohibited pursuant to Department of Defense (DoD) regulation. In another twist, the PCA and its governing regulations do not apply to the Coast Guard. Jurisdictionally, while it remains unclear how the PCA applies outside the United States, it clearly applies to military forces stationed inside the United States to include any troop movement to the Mexico border.

Further confusing matters, the strange term “posse comitatus” is difficult to apply in the modern context. It is a reference to the 19th century problem that the Act sought, in part, to solve – the commandeering of federal troops on the Western frontier to enforce local criminal laws. The days of gathering a “posse” by the local sheriff to hunt down criminals remains, thankfully, in the distant past. Nevertheless, we are stuck with this dated term.

Second, certain exemptions are baked into the PCA’s text and DoD’s implementing regulations. Of central importance is the question of how might the administration attempt to use these legal exemptions to navigate around the blanket prohibition on using the military as a federal law enforcement entity? For example, the PCA does not apply to National Guard members when operating pursuant to state authorities (so-called “Title 32” authorities). On a day-to-day basis, these National Guard troops fall outside the federal chain of command absent an independent trigger that federalizes the force – more on that below. But it remains unclear how the state governors who have first-line authority over their respective National Guards will react to the President’s insistence that they secure the U.S. border. They are certainly not required to do so. For example, does anyone really believe that Governor Jerry Brown will order the California National Guard to secure the border in light of the Trump declaration? I don’t.

In addition, within the law’s text, the PCA carves out an important exemption: a separate “Act of Congress” can remove the PCA’s restrictions. The Insurrection Act, dating from 1807, warrants the most scrutiny. This law authorizes the President to use the armed forces to enforce the law when:

there is an insurrection within a state, and the state legislature (or governor if the state legislature cannot be convened) requests assistance; or the “President considers that unlawful obstructions . . . assemblages, or rebellion against the authority of the United States make it impracticable to enforce the laws of the United States by the ordinary course of judicial proceedings.”

Under the Insurrection Act, the President could legally federalize the National Guard and use the regular military to enforce the law. But there are enormous, likely insurmountable problems with invoking this act’s authority. And the facts that could justify its invocation simply aren’t there. Fundamentally, the states have not requested this authority. And there is no “unlawful obstruction or rebellion” that Trump can easily point to.

Indeed, presidential invocation of the Insurrection Act has been used sparingly and in truly extraordinary circumstances throughout American history: it was last invoked by President George H.W. Bush in the 1992 Los Angeles riots, and was invoked by President Eisenhower in 1957 in Little Rock, Arkansas to ensure the enrollment of African-American schoolchildren in the face of state defiance of a federal court order. Does anyone realistically believe that the migrant “crisis” rises to this level? Any purported migrant “crisis” not only lacks the statutory triggering threshold, it doesn’t pass the historical litmus test. Illegal crossings at the border last year were at the lowest level since 1971.

In making his case to the public, Trump will likely highlight the two circumstances when the Bush and Obama Administrations ordered the military to the U.S.-Mexico border. But in both circumstances, the state governors of California, Arizona, New Mexico and Texas were the ones requesting federal assistance. Here, the roles are reversed and Trump is providing a solution in search of a problem. When Obama and Bush turned to the military in 2006 and 2010, the federal government provided the funding for the National Guard, which remained under the command and control of the governors. Title 32 allows for federal funding of state-controlled National Guard units to include “homeland defense activities” which “includes a threat of aggression against the United States.” But are the migrants crossing the border a threat of aggression against the United States?

Finally, any invocation of the Insurrection Act declaration would likely be subject to judicial challenges: plaintiffs would assert that the President exceeded his constitutional powers and acted outside the scope of his congressionally delegated powers. And they would likely win.

Third, while the PCA prevents the military from providing direct and active support to law enforcement, courts have held that the PCA’s prohibitions do not apply to indirect assistance to law enforcement. But in both circumstances, the military forces operated under very restrictive Rules of Engagement and provided surveillance, administrative, and logistical support to the Customs and Border Patrol – what can fairly be described as indirect support. They did not arrest immigrants attempting to cross the border, precisely because the PCA prohibits such direct assistance.

Relatedly, military members, regardless of their chain of command and legal authority, are clearly authorized to defend the nation from an armed attack and provide for the nation’s defense. Immigration enforcement and policy is outside the historic ambit of the DoD since the nation’s founding and this authority currently resides within the Department of Homeland Security. To assert that the military is taking part in a broader national defense mission defies logic, agency practice, and traditional definitions of historical military functions. And does anyone truly believe that illegal immigration amounts to an armed attack?

Fourth, let’s assume that the military is ordered to the border and the PCA is violated. What are the legal remedies if a violation is found? While the PCA is fundamentally a criminal statute – it is located within Title 18 of U.S. Code that addresses federal criminal law – it has not been enforced against military members as such. Courts have been willing to address the contours of the PCA’s applicability, but in the context of defense counsel requests to exclude evidence obtained by military members taking an active role in law enforcement. In the case of troops deployed to the U.S.-Mexico border who take an active role in law enforcement, those evidentiary challenges are unlikely to arise. The PCA doesn’t criminalize the behavior of the military member herself. It criminalizes the person who willfully uses the soldier as part of a law enforcement mechanism. The obvious questions here include: How far up the chain of command does this apply? Will a superior officer be potentially liable for a criminal violation? What, then, is the practical remedy for a PCA violation? It remains unclear.

Right now, there are more questions than answers about Trump’s latest militarized border pronouncement, but keep a close eye on any forthcoming implementation plan. He faces enormous legal restrictions and challenges in following through on these aspirations. The devil, as they say, is in the details – these four takeaways will help get you started.