The existence of massive (1011 solar masses) elliptical galaxies by redshift z ≈ 4 (refs 1, 2, 3; when the Universe was 1.5 billion years old) necessitates the presence of galaxies with star-formation rates exceeding 100 solar masses per year at z > 6 (corresponding to an age of the Universe of less than 1 billion years). Surveys have discovered hundreds of galaxies at these early cosmic epochs, but their star-formation rates are more than an order of magnitude lower. The only known galaxies with very high star-formation rates at z > 6 are, with one exception, the host galaxies of quasars, but these galaxies also host accreting supermassive (more than 109 solar masses) black holes, which probably affect the properties of the galaxies. Here we report observations of an emission line of singly ionized carbon ([C II] at a wavelength of 158 micrometres) in four galaxies at z > 6 that are companions of quasars, with velocity offsets of less than 600 kilometres per second and linear offsets of less than 100 kiloparsecs. The discovery of these four galaxies was serendipitous; they are close to their companion quasars and appear bright in the far-infrared. On the basis of the [C II] measurements, we estimate star-formation rates in the companions of more than 100 solar masses per year. These sources are similar to the host galaxies of the quasars in [C II] brightness, linewidth and implied dynamical mass, but do not show evidence for accreting supermassive black holes. Similar systems have previously been found at lower redshift. We find such close companions in four out of the twenty-five z > 6 quasars surveyed, a fraction that needs to be accounted for in simulations. If they are representative of the bright end of the [C II] luminosity function, then they can account for the population of massive elliptical galaxies at z ≈ 4 in terms of the density of cosmic space.