Type III secretion systems (TTSS) are unique bacterial mechanisms that mediate elaborate interactions with their hosts. The fact that several of the TTSS proteins are closely related to flagellar export proteins has led to the suggestion that TTSS had evolved from flagella. Here we reconstruct the evolutionary history of four conserved type III secretion proteins and their phylogenetic relationships with flagellar paralogs. Our analysis indicates that the TTSS and the flagellar export mechanism share a common ancestor, but have evolved independently from one another. The suggestion that TTSS genes have evolved from genes encoding flagellar proteins is effectively refuted. A comparison of the species tree, as deduced from 16S rDNA sequences, to the protein phylogenetic trees has led to the identification of several major lateral transfer events involving clusters of TTSS genes. It is hypothesized that horizontal gene transfer has occurred much earlier and more frequently than previously inferred for TTSS genes and is, consequently, a major force shaping the evolution of species that harbor type III secretion systems.