We show that massive stars and stellar clusters are formed simultaneously, the global evolution of the forming cluster is what allows the central stars to become massive. We predict that massive star-forming clumps, such as those observed in Motte et al., contract and grow in mass leading to the formation of massive stars. This occurs as mass is continually channelled from large radii on to the central protostars, which can become massive through accretion. Using smoothed particle hydrodynamic simulations of massive star-forming clumps in a giant molecular cloud, we show that clumps are initially diffuse and filamentary, and become more concentrated as they collapse. Simulated interferometry observations of our data provide an explanation as to why young massive star-forming regions show more substructure than older ones. The most massive stars in our model are found within the most bound cluster. Most of the mass accreted by the massive stars was originally distributed throughout the clump at low densities and was later funnelled to the star due to global infall. Even with radiative feedback no massive pre-stellar cores are formed. The original cores are of intermediate mass and gain their additional mass in the protostellar stage. We also find that cores which form low-mass stars exist within the volume from which the high-mass stars accrete, but are largely unaffected by this process.