The Insurrection Act (10 U.S.C. §§ 251-255) gives the president authority to deploy federal troops or federalize the National Guard within U.S. borders during invasions, rebellions, or when state governments can't enforce federal law. It's one of the few exceptions to the Posse Comitatus Act's ban on military law enforcement.