Fossilized lipids offer a rare glimpse into ancient ecosystems. 2-Methylhopanes in sedimentary rocks were once used to infer the importance of cyanobacteria as primary producers throughout geological history. However, the discovery of hopanoid C-2 methyltransferase (HpnP) in Alphaproteobacteria led to the downfall of this molecular proxy. In the present study, we re-examined the distribution of HpnP in a new phylogenetic framework including recently proposed candidate phyla and re-interpreted a revised geological record of 2-methylhopanes based on contamination-free samples. We show that HpnP was probably present in the last common ancestor of cyanobacteria, while the gene appeared in Alphaproteobacteria only around 750 million years ago (Ma). A subsequent rise of sedimentary 2-methylhopanes around 600 Ma probably reflects the expansion of Alphaproteobacteria that coincided with the rise of eukaryotic algae-possibly connected by algal dependency on microbially produced vitamin B12. Our findings re-establish 2-methylhopanes as cyanobacterial biomarkers before 750 Ma and thus as a potential tool to measure the importance of oxygenic cyanobacteria as primary producers on early Earth. Our study illustrates how genetics can improve the diagnostic value of biomarkers and refine the reconstruction of early ecosystems.