Ankylosing spondylitis (AS) is a potentially disabling form of seronegative spondyloarthritis. The main symptom of AS is inflammatory spinal pain; with time, some patients develop ankylosis and spinal immobility. The pathology mainly affects the entheses, where ligaments, tendons and capsules are attached to the bone. Three processes are observed at the entheses: inflammation, bone erosion and syndesmophyte (spur) formation. Tumor necrosis factor is an important mediator of the inflammatory processes, but this proinflammatory cytokine is not closely involved in bone erosion or syndesmophyte formation. The major causative factors of AS are genetic, with the gene encoding HLA-B27 being the most important genetic factor. Several other susceptibility genes have also been identified. An enormous number of papers have been published and many diverse hypotheses have been generated regarding the pathogenesis of AS. This Review outlines the key areas of current research in this field, describes several hypotheses regarding the pathogenesis of AS, which are under intense investigation, and concludes with a dissection of the processes involved in bone erosion and syndesmophyte formation.