Bacterial pathogens produce complex carbohydrate capsules to protect against bactericidal immune molecules. Paradoxically, the pneumococcal capsule sensitizes the bacterium to antimicrobial peptides found on epithelial surfaces. Here we show that upon interaction with antimicrobial peptides, encapsulated pneumococci survive by removing capsule from the cell surface within minutes in a process dependent on the suicidal amidase autolysin LytA. In contrast to classical bacterial autolysis, during capsule shedding, LytA promotes bacterial survival and is dispersed circumferentially around the cell. However, both autolysis and capsule shedding depend on the cell wall hydrolytic activity of LytA. Capsule shedding drastically increases invasion of epithelial cells and is the main pathway by which pneumococci reduce surface bound capsule during early acute lung infection of mice. The previously unrecognized role of LytA in removing capsule to combat antimicrobial peptides may explain why nearly all clinical isolates of pneumococci conserve this enzyme despite the lethal selective pressure of antibiotics.