Understanding the structural biology of type IV pili, fibres responsible for the virulent attachment and motility of numerous bacterial pathogens, requires a detailed understanding of the three-dimensional structure and chemistry of the constituent pilin subunit. X-ray crystallographic refinement of Neisseria gonorrhoeae pilin against diffraction data to 2.6 A resolution, coupled with mass spectrometry of peptide fragments, reveals phosphoserine at residue 68. Phosphoserine is exposed on the surface of the modelled type IV pilus at the interface of neighbouring pilin molecules. The site-specific mutation of serine 68 to alanine showed that the loss of the phosphorylation alters the morphology of fibres examined by electron microscopy without a notable effect on adhesion, transformation, piliation or twitching motility. The structural and chemical characterization of protein phosphoserine in type IV pilin subunits is an important indication that this modification, key to numerous regulatory aspects of eukaryotic cell biology, exists in the virulence factor proteins of bacterial pathogens. These O-linked phosphate modifications, unusual in prokaryotes, thus merit study for possible roles in pilus biogenesis and modulation of pilin chemistry for optimal in vivo function.