Steroids are essential triterpenoid molecules that are present in all eukaryotes and modulate the fluidity and flexibility of cell membranes. Steroids also serve as signalling molecules that are crucial for growth, development and differentiation of multicellular organisms1-3. The steroid biosynthetic pathway is highly conserved and is key in eukaryote evolution4-7. The flavoprotein squalene epoxidase (SQE) catalyses the first oxygenation reaction in this pathway and is rate limiting. However, despite its conservation in animals, plants and fungi, several phylogenetically widely distributed eukaryote genomes lack an SQE-encoding gene7,8. Here, we discovered and characterized an alternative SQE (AltSQE) belonging to the fatty acid hydroxylase superfamily. AltSQE was identified through screening of a gene library of the diatom Phaeodactylum tricornutum in a SQE-deficient yeast. In accordance with its divergent protein structure and need for cofactors, we found that AltSQE is insensitive to the conventional SQE inhibitor terbinafine. AltSQE is present in many eukaryotic lineages but is mutually exclusive with SQE and shows a patchy distribution within monophyletic clades. Our discovery provides an alternative element for the conserved steroid biosynthesis pathway, raises questions about eukaryote metabolic evolution and opens routes to develop selective SQE inhibitors to control hazardous organisms.