Stellar theory predicts a forbidden range of black-hole masses between approximately 50 M⊙ and 130 M⊙ owing to pair-instability supernovae1–7, but evidence for such a gap in the mass distribution from gravitational-wave astronomy has proved elusive. Early hints of a cut-off in black-hole masses at about 45 M⊙ disappeared with the subsequent discovery of more massive binary black holes8,9. Here we report evidence of the pair-instability gap in LIGO–Virgo–KAGRA’s fourth Gravitational-Wave Transient Catalog (GWTC-4), with a lower boundary of \(4{4}_{-4}^{+5}\,{M}_{\odot }\) (90% credibility). Although the gap is not present in the distribution of primary masses m1 (the bigger of the two black holes in a binary system), it appears unambiguously in the distribution of secondary masses m2, in which m2 ≤ m1. The location of the gap lines up well with a previously identified transition in the binary black-hole spin distribution; binaries with primary components in the gap tend to spin more rapidly than those below the gap. We interpret these findings as evidence for a subpopulation of hierarchical mergers: binaries in which the primary component is the product of a previous black-hole merger and thus populates the gap. Our measurement of the location of the pair-instability gap constrains the S-factor for 12C(α, γ)16O at 300 keV to \(26{0}_{-108}^{+190}\,{\rm{keV}}\,{\rm{barns}}\) .