Sterol 14alpha-demethylase (CYP51) is a member of the cytochrome P450 superfamily, widely found in animals, fungi, and plants but present in few prokaryotic groups. CYP51 is currently believed to be the ancestral cytochrome P450 that has been transferred from prokaryotes to eukaryotic kingdoms. We propose an alternate view of CYP51 evolution that has an impact on understanding the evolution of the entire CYP superfamily. Two hundred forty-nine bacterial and four archaeal CYP sequences have been aligned and a bacterial CYP tree designed, showing a separation of two branches. Prokaryotic CYP51s cluster to the minor branch, together with other eukaryote-like CYPs. Mycobacterial and methylococcal CYP51s cluster together (100% bootstrap probability), while Streptomyces CYP51 remains on a distant branch. A CYP51 phylogenetic tree has been constructed from 44 sequences resulting in a ((plant, bacteria),(animal, fungi)) topology (100% bootstrap probability). This is in accordance with the lanosterol/cycloartenol diversification of sterol biosynthesis. The lanosterol branch (nonphotosynthetic lineage) follows the previously proposed topology of animal and fungal orthologues (100% bootstrap probability), while plant and D. discoideum CYP51s belong to the cycloartenol branch (photosynthetic lineage), all in accordance with biochemical data. Bacterial CYP51s cluster within the cycloartenol branch (69% bootstrap probability), which is indicative of a lateral gene transfer of a plant CYP51 to the methylococcal/mycobacterial progenitor, suggesting further that bacterial CYP51s are not the oldest CYP genes. Lateral gene transfer is likely far more important than hitherto thought in the development of the diversified CYP superfamily. Consequently, bacterial CYPs may represent a mixture of genes with prokaryotic and eukaryotic origin.