The Posse Comitatus Act was passed in 1876. It provides a defined legal barrier between civilian and military authority in the United States, though it has always existed in a nebulous common law sense. According to Black's Law Dictionary, "posse comitatus" means
the power or force of the county. The entire population of a county above the age of fifteen, which a sheriff may summon to his assistance in certain cases as to aid him in keeping the peace, in pursuing and arresting felons, etc.
The Posse Comitatus Act was intended in part to end the use of federal troops in protecting state elections in the former Confederate states after the Civil War. In 18 U.S. Code, Section 1385, the law defines the role of the Army and Air Force in executing civil law:
Whoever, except in cases and under circumstances expressly 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 not more than $10,000 or imprisoned not more than two years, or both.
The Air Force was added to the law in 1956. Even though the Navy and Marine Corps aren't included in the act, they were made subject to it by Department of Defense Regulation 32 C.F.R. Section 213.2, 1992.

There are a lot of exceptions to the Act. In fact, there are so many that I, not a legal scholar, can't really determine what is actually restricted. National Guard forces, operating under state authority, are exempt. Within the President's authority to quell "domestic violence," basically rebellion or any situation which restricts judicial proceedings, this exemption applies to active-duty military and federalized National Guard troops. Military aerial photographic and visual search and surveillance troops also have been found to not violate the Posse Comitatus Act. Congress also created a "drug exception." They authorized the Secretary of Defense to make any military equipment and necessary personnel available for the "war on drugs." The Judge Advocate Corps can act as assistant prosecutor in civil cases. The Coast Guard, during peacetime, is a Department of Transportation agency and is wholly exempt. The Navy can help the Coast Guard in pursuit, search and seizure of vessels suspected of drug trafficking.

In nearly 120 years, the PCA, a criminal law, has never been tested in court, though some have argued in their defense, and some succesfully, that the PCA rendered evidence or charges inadmissable within a court's jurisdiction. In the U.S., exceptions-in-fact include the usage of troops when schools were desegregated in the south, and quelling riots in Detroit, and in LA after the Rodney King verdict. Also troops have replaced striking federal workers in New York City (postal service) and air traffic controllers. Also troops have been used in disaster relief efforts, which is OK because they are not executing laws.

The PCA is a fairly simple law with complex exceptions and nuances. For a dry interpretation of the law, its consequences and exceptions, I highly recommend the RAND file on this topic http://www.rand.org/publications/MR/MR1251/MR1251.AppD.pdf . Also check out an extensive research paper on why the PCA is an essential by the Washington University Law Quarterly at http://law.wustl.edu/WULQ/75-2/752-10.html.

Log in or register to write something here or to contact authors.