Exopolysaccharides are required for the development and integrity of biofilms produced by a wide variety of bacteria. In Escherichia coli, partial de-N-acetylation of the exopolysaccharide poly-β-1,6-N-acetyl-D-glucosamine (PNAG) by the periplasmic protein PgaB is required for polysaccharide intercellular adhesin-dependent biofilm formation. To understand the molecular basis for PNAG de-N-acetylation, the structure of PgaB in complex with Ni(2+) and Fe(3+) have been determined to 1.9 and 2.1 Å resolution, respectively, and its activity on β-1,6-GlcNAc oligomers has been characterized. The structure of PgaB reveals two (β/α)(x) barrel domains: a metal-binding de-N-acetylase that is a member of the family 4 carbohydrate esterases (CE4s) and a domain structurally similar to glycoside hydrolases. PgaB displays de-N-acetylase activity on β-1,6-GlcNAc oligomers but not on the β-1,4-(GlcNAc)(4) oligomer chitotetraose and is the first CE4 member to exhibit this substrate specificity. De-N-acetylation occurs in a length-dependent manor, and specificity is observed for the position of de-N-acetylation. A key aspartic acid involved in de-N-acetylation, normally seen in other CE4s, is missing in PgaB, suggesting that the activity of PgaB is attenuated to maintain the low levels of de-N-acetylation of PNAG observed in vivo. The metal dependence of PgaB is different from most CE4s, because PgaB shows increased rates of de-N-acetylation with Co(2+) and Ni(2+) under aerobic conditions, and Co(2+), Ni(2+) and Fe(2+) under anaerobic conditions, but decreased activity with Zn(2+). The work presented herein will guide inhibitor design to combat biofilm formation by E. coli and potentially a wide range of medically relevant bacteria producing polysaccharide intercellular adhesin-dependent biofilms.