Unravelling the basis of variation in inflorescence architecture is important to understanding how the huge diversity in plant form has been generated. Inflorescences are divided between simple, as in Arabidopsis, with flowers directly formed at the main primary inflorescence axis, and compound, as in legumes, where they are formed at secondary or even higher order axes. The formation of secondary inflorescences predicts a novel genetic function in the development of the compound inflorescences. Here we show that in pea this function is controlled by VEGETATIVE1 (VEG1), whose mutation replaces secondary inflorescences by vegetative branches. We identify VEG1 as an AGL79-like MADS-box gene that specifies secondary inflorescence meristem identity. VEG1 misexpression in meristem identity mutants causes ectopic secondary inflorescence formation, suggesting a model for compound inflorescence development based on antagonistic interactions between VEG1 and genes conferring primary inflorescence and floral identity. Our study defines a novel mechanism to generate inflorescence complexity.