The Department of Defense (DoD) has multiple law enforcement agencies. The Army, Navy, Marine Corps, and the Air Force1 do not generally involve themselves in civilian law enforcement. The military is generally responsible for the defence of the United States of America while law enforcement is left to the law enforcement agencies at the federal, state, and primarily the local level. However, DoD has a very limited in the role that it can play in law enforcement.
Each branch of DoD uses service members as Military Police (MP). MPs maintain order on military bases. They function just as police officers in the civilian areas. They also help local police with troops off-base and maintain order in occupied areas. The US Army Military Police and the US Marine Corps Military Police perform the military police function for their services. The Air Force refers to them as US Air Force Security Forces. The Navy refers to them as Masters-at-Arms or the Shore Patrol.
In some areas, particularly overseas, service members who are not trained as police will be pressed into that role. They may be referred to as Unit Police. They are there to augment the military police. For instance, some small camps might not have a military police presence. The duty for Unit Police might rotate among the Non-Commissioned Officers (NCO) to make sure that the service members in the adjoining community are under control.
Some military police receive special investigations training and become Military Police Investigators (MPI). In the Air Force, they're called Security Forces Investigators. They handle misdemeanor crimes. Felonies are investigated by the appropriate Military Criminal Investigative Organisation (MICO).
There are numerous small law enforcement agencies in the DoD. They are also known as DoD Police. They protect facilities where military police are no longer used. Some examples include United States Naval Academy Police Department.
Several agencies are more specialised. The National Security Agency Police protect NSA facilities. The Pentagon Force Protection Agency has absorbed the Defense Protection Agency2. It is responsible for protecting the Pentagon and DoD assets throughout the National Capital Region.
Military Criminal Investigative Organisations
There are four agencies that are considered Military Criminal Investigative Organisations (MICO). They are the Defense Criminal Investigative Service (DCIS), United States Army Criminal Investigation Command (CID), Naval Criminal Investigative Service (NCIS), and US Air Force Office of Special Investigations (AFOSI).
They perform much the same roll as police detectives in the civilian community. They are some of the most respected law enforcement organisations in the country. AFOSI and the NCIS are also responsible for counter-intelligence and counter-terrorist operations. The Army has other organisations that handle that function.
NCIS primarily employs civilian agents, although there are a few Marine Special Agents (MSA) detailed to them. One thing that makes their career more interesting is that some special agents serve afloat on aircraft carriers. AFOSI employs enlisted, commissioned, civilian, and reserve agents. They're used interchangeably. CID employs military and civilian special agents, but the civilian special agents are only used for fraud investigations. All other investigations are handled by enlisted, warrant or commissioned special agents.
There is also the Defense Logistics Agency Criminal Investigations Activity (DCIA) which investigates fraud for the Defense Logistics Agency.
Judge Advocate General
The Judge Advocate General (JAG) of the various services provides lawyers for the military. JAG is made up of the judges, the prosecutors, and defence attorneys for the military justice system. JAG attorneys also advise military commanders and service members, and they represent the military when necessary in civilian courts.
The Posse Comitatus Act of 1878
The Army used to be heavily involved in law enforcement, particularly in the old west. In 1878, Congress enacted the Posse Comitatus Act, which prohibited the Army3 from assisting law enforcement directly except when authorised by the Constitution or Congress. These restrictions don't apply to the Department of the Navy by law, however DoD regulations prohibit marines and sailors from engaging in civilian law enforcement.
Obviously, there are limits to this restriction. First off, the Army and Air Force can protect their facilities. They have the power to arrest people who are on military reservations. National Guard troops are state troops, and they can be used by the governors of the states to enforce law and order. Posse comitatus4 restrictions have been relaxed for some drug interdiction operations. These restrictions do not apply to civilian special agents employed by the Army or Air Force.
Military Reservations and Jurisdiction
Most military bases are military reservations where the military has exclusive jurisdiction. State law enforcement officers don't have the authority to enter a reservation and make arrests. There are some areas where the military will have concurrent jurisdiction with local agencies. These would be areas where the military or civilian law enforcement agencies would have authority to act.
To prevent Congress from having to create a completely new set of laws to govern areas where the federal government has exclusive jurisdiction, they created the Law of Assumption. That means that the military will enforce state laws within the reservation. Cases tried under the Law of Assumption are tried in the local federal magistrate or district court using state laws. The Law of Assumption is not just used on military reservations; it applies anywhere that the federal government has exclusive of concurrent jurisdiction, such as national parks.
The Law of Assumption is in addition to the Uniform Code of Military Justice that military authorities routinely enforce.
Status of Forces Agreements
When the military is deployed overseas, unless special provisions exist, they are subject to the laws of the host government. Additionally, service members are responsible to the military for their conduct while on or off duty. In many cases, the Unites States has negotiated Status of Forces Agreements (SOFA) with host nations to address who has authority over service members. These agreements will generally allow the military to try and punish soldiers for conduct committed off-base in accordance with the Uniform Code of Military Justice. However, the military will not always exercise these rights, and they will turn service members over to the host government for prosecution.
Under the Law of War, the local government in an occupied area should ideally be allowed to function as before. It'll be answerable to a military governor though. Therefore, functions like the police etc, can go on. If the local government is incapable of functioning, then the occupier just takes over those functions. That's once of the main missions of the Army MPs. They're responsible for rear area security.