The Posse Comitatus Act is a federal law that restricts the use of the U.S. Army and Air Force from acting as law enforcement or to execute the law, unless expressly authorized by Congress or the Constitution. Originally passed in 1878, it has been expanded to include the Navy, Marine Corps, and Space Force, though it does not apply to the National Guard when it's operating under state control. The act, however, contains many exceptions and loopholes, such as for counter-drug operations or emergencies involving weapons of mass destruction, and its application is often a subject of debate, especially in situations involving immigration enforcement.