A global health problem concerns the evolution of antibiotic-resistant bacteria. A characteristic of these super bug pathogens is their ability to form an exopolysaccharide matrix, the capsule, allowing them to resist antibiotic treatment and other environmental stresses. Here we apply atomic force microscopy (AFM) to interrogate living bacterial cells and provide the first in situ measurements of the biophysical behaviour of the capsule in physiologically relevant conditions. We prepared live Klebsiella pneumoniae, a common pathogen that has evolved super bug strains. We measured how capsule, cell wall and cell cytoplasm of wild type and capsule-deficient bacterial cells respond when indented by an AFM tip, under extreme osmotic conditions. By developing a mechanical model for the indentation of bacteria and fitting the force profiles to this model, we discovered that the organisation and hydration of the capsule alter in response to the osmotic environment, but surprisingly there is no change in cytoplasmic turgor pressure. The capsule deficient mutants however, experience extreme change in turgor pressure under altered osmotic conditions. Our results provide new insight on the biophysical behaviour of the bacterial capsule, demonstrating that it is a polymer hydrogel that acts as an ion sponge to dampen the impact of osmotic stress. Nano-mechanical screening for additives to medical plastics that alter the properties of this ion sponge represents a new way to address the problems associated with antibiotic-resistant bacteria. ? 2013 The Royal Society of Chemistry.