Sterol biosynthesis, primarily associated with eukaryotic kingdoms of life, occurs as an abbreviated pathway in the bacterium Methylococcus capsulatus. Sterol 14α-demethylation is an essential step in this pathway and is catalyzed by cytochrome P450 51 (CYP51). In M. capsulatus the enzyme consists of the P450 domain naturally fused to a ferredoxin domain at the C-terminus (CYP51fx). The structure of M. capsulatus CYP51fx was solved to 2.7 Å resolution and is the first structure of a bacterial sterol biosynthetic enzyme. The structure contained one P450 molecule per asymmetric unit with no electron density seen for ferredoxin. We connect this with the requirement of P450 substrate binding in order to activate productive ferredoxin binding. Further, the structure of the P450 domain with bound detergent (which replaced the substrate upon crystallization) was solved to 2.4 Å resolution. Comparison of these two structures to the CYP51s from human, fungi and protozoa reveals strict conservation of the overall protein architecture. However, the structure of an “orphan” P450 from non-sterol producing Mycobacterium tuberculosis that also has CYP51 activity reveals marked differences, suggesting that loss of function in vivo might have led to alterations in the structural constraints. Our results are consistent with the idea that eukaryotic and bacterial CYP51s evolved from a common cenancestor and that early eukaryotes may have recruited CYP51 from a bacterial source. The idea is supported by bioinformatic analysis, revealing the presence of CYP51 genes in > 1000 bacteria from 9 different phyla, more than 50 of them being natural CYP51fx fusion proteins.