We present a model for the formation of massive (M≳10 M) stars through accretion-induced collisions in the cores of embedded dense stellar clusters. This model circumvents the problem of accreting on to a star whose luminosity is sufficient to reverse the infall of gas. Instead, the central core of the cluster accretes from the surrounding gas, thereby decreasing its radius until collisions between individual components become sufficient. These components are, in general, intermediate-mass stars that have formed through accretion on to low-mass protostars. Once a sufficiently massive star has formed to expel the remaining gas, the cluster expands in accordance with this loss of mass, halting further collisions. This process implies a critical stellar density for the formation of massive stars, and a high rate of binaries formed by tidal capture.