Massive galaxy clusters have been found that date to times as early as three billion years after the Big Bang, containing stars that formed at even earlier epochs1-3. The high-redshift progenitors of these galaxy clusters—termed `protoclusters'—can be identified in cosmological simulations that have the highest overdensities (greater-than-average densities) of dark matter4-6. Protoclusters are expected to contain extremely massive galaxies that can be observed as luminous starbursts7. However, recent detections of possible protoclusters hosting such starbursts8-11 do not support the kind of rapid cluster-core formation expected from simulations12: the structures observed contain only a handful of starbursting galaxies spread throughout a broad region, with poor evidence for eventual collapse into a protocluster. Here we report observations of carbon monoxide and ionized carbon emission from the source SPT2349-56. We find that this source consists of at least 14 gas-rich galaxies, all lying at redshifts of 4.31. We demonstrate that each of these galaxies is forming stars between 50 and 1,000 times more quickly than our own Milky Way, and that all are located within a projected region that is only around 130 kiloparsecs in diameter. This galaxy surface density is more than ten times the average blank-field value (integrated over all redshifts), and more than 1,000 times the average field volume density. The velocity dispersion (approximately 410 kilometres per second) of these galaxies and the enormous gas and star-formation densities suggest that this system represents the core of a cluster of galaxies that was already at an advanced stage of formation when the Universe was only 1.4 billion years old. A comparison with other known protoclusters at high redshifts shows that SPT2349-56 could be building one of the most massive structures in the Universe today.