HLA-B27 is strongly associated with spondyloarthropathies, including ankylosing spondylitis and reactive arthritis. The latter disease is triggered by various Gram-negative bacteria. A dodecamer derived from the intracytoplasmic tail of HLA-B27 was a natural ligand of three disease-associated subtypes (B*2702, B*2704, and B*2705) but not of two (B*2706 and B*2709), weakly or not associated to spondyloarthropathy. This peptide was strikingly homologous to protein sequences from arthritogenic bacteria, particularly to a region of the DNA primase from Chlamydia trachomatis. A synthetic peptide with this bacterial sequence bound in vitro disease-associated subtypes equally as the natural B27-derived ligand. The chlamydial peptide was generated by the 20 S proteasome from a synthetic 28-mer with the sequence of the corresponding region of the bacterial DNA primase. Molecular modeling suggested that the B27-derived and chlamydial peptides adopt very similar conformations in complex with B*2705. The results demonstrate that an HLA-B27-derived peptide mimicking arthritogenic bacterial sequences is a natural ligand of disease-associated HLA-B27 subtypes and suggest that the homologous chlamydial peptide might be presented by HLA-B27 on Chlamydia-infected cells.