Vicia sativa ssp. amphicarpa is a unique forage crop capable of simultaneously producing fruits above and below ground, representing a typical amphicarpic plant. In this study, we sequenced and assembled seven pseudo-chromosomes of the genome of V. sativa ssp. amphicarpa (n = 7) yielding a genome size of 1.59 Gb, with a total annotation of 48 932 protein-coding genes. Long terminal repeat (LTR) elements constituted 62.28% of the genome, significantly contributing to the expansion of genome size. Phylogenetic analysis revealed that the divergence between V. sativa ssp. amphicarpa and V. sativa was around 0.88 million years ago (MYA). Comparative transcriptomic and metabolomic analysis of aerial and subterranean pod shells showed biosynthesis of terpenoids in the subterranean pod shells indicating a correlation between the antimicrobial activity of subterranean pod shells and the biosynthesis of terpenoids. Furthermore, functional validation indicates that overexpression of VsTPS5 and VsTPS16 enhances terpenoid biosynthesis for antibacterial activity. Metabolomic analysis suggests the involvement of terpenoids in the antimicrobial properties of subterranean pod shells. Deciphering the genome of V. sativa ssp. amphicarpa elucidated the molecular mechanisms behind the antimicrobial properties of subterranean fruits in amphicarpic plants, providing valuable insights for the study of amphicarpic plant biology.