More than three decades after the discovery of HLA-B27 as a major genetic clue to the origins of ankylosing spondylitis, much has been learned about pathogenesis. However, the role of this major histocompatibility complex class I allele remains undefined. Studies from animal models have demonstrated that HLA-B27 overexpression can cause inflammatory disease with spondyloarthritis features, and together with investigations of patient-derived material, both innate adaptive and immune responses have been implicated. The gastrointestinal immune response to pathogens and even normal flora, with subclinical or overt inflammation, may play a role as an environmental component of these diseases. Although there has been a large conceptual emphasis on mechanisms involving autoreactive T-cell recognition of HLA-B27 complexes displaying arthritogenic peptides, and more recently non-canonical recognition of abnormal forms of HLA-B27 free of beta(2)m (heavy-chain dimers or monomers), it remains unclear whether immunological recognition plays a role in pathogenesis. The recognition that the HLA-B27 heavy chain misfolds during assembly, and causes endoplasmic reticulum 'stress', has led to the observation that this activates the unfolded protein response. This has opened additional areas of investigation into the response of immune system cells to protein misfolding, and suggested novel alternative concepts that may explain the role of HLA-B27 in pathogenesis. This chapter will discuss available data and current concepts regarding the pathogenesis of ankylosing spondylitis.