  According to the current understanding of cosmic structure formation, the
precursors of the most massive structures in the Universe began to form shortly
after the Big Bang, in regions corresponding to the largest fluctuations in the
cosmic density field. Observing these structures during their period of active
growth and assembly - the first few hundred million years of the Universe - is
challenging because it requires surveys that are sensitive enough to detect the
distant galaxies that act as signposts for these structures and wide enough to
capture the rarest objects. As a result, very few such objects have been
detected so far. Here we report observations of a far-infrared-luminous object
at redshift 6.900 (less than 800 Myr after the Big Bang) that was discovered in
a wide-field survey. High-resolution imaging reveals this source to be a pair
of extremely massive star-forming galaxies. The larger of these galaxies is
forming stars at a rate of 2900 solar masses per year, contains 270 billion
solar masses of gas and 2.5 billion solar masses of dust, and is more massive
than any other known object at a redshift of more than 6. Its rapid star
formation is probably triggered by its companion galaxy at a projected
separation of just 8 kiloparsecs. This merging companion hosts 35 billion solar
masses of stars and has a star-formation rate of 540 solar masses per year, but
has an order of magnitude less gas and dust than its neighbor and physical
conditions akin to those observed in lower-metallicity galaxies in the nearby
Universe. These objects suggest the presence of a dark-matter halo with a mass
of more than 400 billion solar masses, making it among the rarest dark-matter
haloes that should exist in the Universe at this epoch.
