Convergent evolution is a process that has occurred throughout the tree of life, but the historical genetic and biochemical context promoting the repeated independent origins of a trait is rarely understood. The well-known stimulant caffeine, and its xanthine alkaloid precursors, has evolved multiple times in flowering plant history for various roles in plant defense and pollination. We have shown that convergent caffeine production, surprisingly, has evolved by two previously unknown biochemical pathways in chocolate, citrus, and guaraná plants using either caffeine synthaseor xanthine methyltransferase-like enzymes. However, the pathway and enzyme lineage used by any given plant species is not predictable from phylogenetic relatedness alone. Ancestral sequence resurrection reveals that this convergence was facilitated by co-option of genes maintained over 100 million y for alternative biochemical roles. The ancient enzymes of the Citrus lineage were exapted for reactions currently used for various steps of caffeine biosynthesis and required very few mutations to acquire modern-day enzymatic characteristics, allowing for the evolution of a complete pathway. Future studies aimed at manipulating caffeine content of plants will require the use of different approaches given the metabolic and genetic diversity revealed by this study. convergent evolution | caffeine biosynthesis | enzyme evolution | paleomolecular biology