We determined almost complete flagellin gene sequences of various Borrelia species and aligned them with previously published sequences. A neighbor-joining phylogenetic analysis showed that the genus Borrelia was divided into the following three major clusters: New World relapsing fever borreliae (Borrelia turicatae, Borrelia parkeri, and Borrelia hermsii), Old World relapsing fever borreliae (Borrelia crocidurae, Borrelia duttonii, and Borrelia hispanica), and Lyme disease borreliae (Borrelia burgdorferi sensu stricto, Borrelia garinii, and Borrelia afzelii). Agents of animal spirochetosis (Borrelia coriaceae and Borrelia anserina) and species of unknown pathogenicity (Borrelia miyamotoi and Borrelia lonestari) were related to relapsing fever borreliae. Although the Lyme disease borreliae, two related species (Borrelia japonica and Borrelia andersonii), and some newly described genomic groups (groups PotiB2, VS116, DN127, Hk501, and Ya501) were closely related to each other, each taxon formed an independent branch on the phylogenetic tree. The data obtained in this study indicate that the flagellin genes are useful in Borrelia taxonomy. To distinguish the Lyme disease borreliae from related organisms easily, we designed an oligonucleotide primer set for the flagellin gene and performed a PCR-restriction fragment length polymorphism (PCR-RFLP) analysis. The primer set amplified an approximately 580-bp DNA fragment that included species-specific restriction sites, and HapII, HhaI, CelII, HincII, or DdeI digestion of the product resulted in distinctively different PCR-RFLP patterns. The PCR-RFLP typing method which we developed should facilitate rapid identification of Lyme disease borreliae and related organisms obtained from biological and clinical specimens.