Bacterial pathogens have evolved diverse and intricate mechanisms to evade the human immune system, including the production of immunomodulatory enzymes. Streptococcus pyogenes secretes two multi-modular endo-β-N-acetylglucosaminidases, EndoS and EndoS2, that specifically deglycosylate the conserved N-linked glycan at Asn297 on IgG Fc, disabling antibody-mediated effector functions. Amongst thousands of known carbohydrate-active enzymes, EndoS and EndoS2 represent just a handful of enzymes that are specific to the protein portion of the glycoprotein substrate, not just the glycan component. Here, we present the cryoEM structure of EndoS in complex with the IgG1 Fc fragment. In combination with small-angle X-ray scattering, alanine scanning mutagenesis, hydrolytic activity measurements, enzyme kinetics, nuclear magnetic resonance and molecular dynamics analysis, we establish the mechanisms of recognition and specific deglycosylation of IgG antibodies by EndoS and EndoS2. Our results provide a rational basis from which to engineer novel enzymes with antibody and glycan selectivity for clinical and biotechnological applications.