Clinicians have commonly differentiated chronic back pain into two broad subsets: namely, non-inflammatory (or mechanical) back pain and inflammatory back pain. As the terminology suggests, the latter category, in which ankylosing spondylitis (AS) is prominent, presupposes a close link between pain and inflammation. Advances in research into the genetics and immunology of AS have improved our understanding of the inflammatory processes involved in this disease, and have led to the development of potent anti-inflammatory biologic therapeutic agents. However, evidence from clinical trials and from biomarker and imaging studies in patients with AS indicate that pain and inflammation are not always correlated. Thus, the assumption that pain in AS is a reliable surrogate marker for inflammation might be an over-simplification. This Review provides an overview of current concepts relating to neuro-immune interactions in AS and summarizes research that reveals an increasingly complex interplay between the activation of the immune system and pain pathways in the nervous system. The different types of pain experienced by patients with AS, insights from brain imaging studies, neurological mechanisms of pain, sex bias in pain and how the immune system can modify pain in patients with AS are also discussed.