Ankylosing spondylitis (AS) and Reiter's syndrome (RS) both show a strong correlation with the HLA B27 haplotype. We studied whether sharing of homologous amino acid sequences in the HLA B27 antigen with an invading microbe might occur, and if so, what is the biological significance of such homology. In a computer search of the Dayhoff data bank, we found a homology of six consecutive amino acids between HLA B27.1 antigen residues 72-77 and Klebsiella pneumoniae nitrogenase residues 188-193. These shared sequences are hydrophilic, suggesting locations on molecules exposed to the cell surface. Immunochemical analysis showed that 18 of 34 sera from patients with RS (53%) and 7 of 24 sera from patients with AS (29%) contained antibodies that bound to a synthesized peptide sequence representing residues 69-84 of HLA B27.1. In contrast, only 1 of 22 sera from healthy, B27+ controls (5%) contained antibodies to this peptide (p less than 0.01). Sera from three HLA B27- patients with RS did not possess antibodies to the HLA B27 peptide. Additionally, greater than 40% of HLA B27 patients with AS or RS had antibodies to Klebsiella residues 184-193, while none of the normal nonarthritic HLA B27 haplotype subjects did. Our results suggest that an autoimmune response(s) directed against HLA B27.1 may be a pathogenic mechanism in a subset of patients with AS and RS. Further, this response may initially be induced against Klebsiella pneumoniae, a microorganism that shares sequence homology with HLA B27.