The meroterpenoid hyperforin is responsible for the antidepressant activity of St John’s wort extracts, but the genes controlling its biosynthesis are unknown. Using genome mining and biochemical work, we characterize two biosynthetic gene clusters (BGCs) that encode the first three steps in the biosynthesis of hyperforin precursors. The findings of syntenic and phylogenetic analyses reveal the parallel assembly of the two BGCs. The syntenous BGC in Mesua ferrea indicates that the first cluster was assembled before the divergence of the Hypericaceae and Calophyllaceae families. The assembly of the second cluster is the result of a coalescence of genomic fragments after a major duplication event. The differences between the two BGCs – in terms of gene expression, response to methyl jasmonate, substrate specificity and subcellular localization of key enzymes – suggest that the presence of the two clusters could serve to generate separate pools of precursors. The parallel assembly of two BGCs with similar compositions in a single plant species is uncommon, and our work provides insights into how and when these gene clusters form. Our discovery helps to advance our understanding of the evolution of plant specialized metabolism and its genomic organization. Additionally, our results offer a foundation from which hyperforin biosynthesis can be more fully understood, and which can be used in future metabolic engineering applications.