Twelve days before the November 2018 midterm elections, the President of the United States ordered active-duty military forces to assist in immigration enforcement on the Southern border for the first time in American history. This was yet another dismally extraordinary fact of our dismally extraordinary times, but one for which you may be forgiven having forgotten not even six months later.

It was also almost certainly illegal under a 141-year-old law originally passed by Congress in support of the Ku Klux Klan.

For a dozen years after the end of the Civil War, the U. S. Army conducted a lengthy (and largely successful) campaign against the KKK. The Klan presented the single greatest organized threat to Reconstruction, and its brutal enforcement of antebellum racial norms would never have been contained by local law enforcement alone. The Klan and its many supporters were so upset by this Northern intrusion into local affairs that Southern Democrats made total withdrawal of these troops one of the leading demands of the election-deciding Compromise of 1876. They also forced President Rutherford B. Hayes to sign the Posse Comitatus Act, under which it became a federal crime—one carrying up to two years in federal prison—to intentionally “use any part of the Army… as a posse comitatus or otherwise to execute the laws.” (No one has ever been charged with or convicted of this offense.)

Despite these explicitly racist origins, the Act is a vital guarantor of our civil liberties. Deploying military forces as an armed posse comitatus (Latin for “power of the county”) to enforce domestic law is a distinctly un-American idea, and very much the kind of thing that pushed American colonists to rebel against British autocracy.

Posse comitatus has also always been a rule that threatens to be swallowed up by exceptions. At the time that the Act was signed by President Hayes, the Army was assisting local law enforcement in Lincoln County, New Mexico in hunting down “a band of miscreants” which included Billy the Kid. The military was so annoyed by the order to stand down that the President was almost immediately persuaded to sign a special proclamation permitting the operation to continue. Troops have since been deployed against everyone from “Bonus Army” WWI veterans to striking West Virginia coal miners to Waco Branch Davidian cultists, generally under circumstances which were never clearly legal. (At the request of state governors, Presidents Clinton, George W. Bush, and Barack Obama all briefly sent National Guard troops to the border —but none of them ever sent active-duty service members.)