Owing to their similarities with giant exoplanets, brown dwarf companions of stars provide insights into the fundamental processes of planet formation and evolution. From their orbits, several brown dwarf companions are found to be more massive than theoretical predictions given their luminosities and the ages of their host stars1-3. Either the theory is incomplete or these objects are not single entities. For example, they could be two brown dwarfs each with a lower mass and intrinsic luminosity1,4. The most problematic example is Gliese 229 B (refs. 5,6), which is at least 2-6 times less luminous than model predictions given its dynamical mass of 71.4 ± 0.6 Jupiter masses (MJup) (ref. 1). We observed Gliese 229 B with the GRAVITY interferometer and, separately, the CRIRES+ spectrograph at the Very Large Telescope. Both sets of observations independently resolve Gliese 229 B into two components, Gliese 229 Ba and Bb, settling the conflict between theory and observations. The two objects have a flux ratio of 0.47 ± 0.03 at a wavelength of 2 μm and masses of 38.1 ± 1.0 and 34.4 ± 1.5 MJup, respectively. They orbit each other every 12.1 days with a semimajor axis of 0.042 astronomical units (AU). The discovery of Gliese 229 BaBb, each only a few times more massive than the most massive planets, and separated by 16 times the Earth-moon distance, raises new questions about the formation and prevalence of tight binary brown dwarfs around stars.