White dwarfs represent the last stage of evolution of stars with mass less than about eight times that of the Sun and, like other stars, are often found in binaries. If the orbital period of the binary is short enough, energy losses from gravitational-wave radiation can shrink the orbit until the two white dwarfs come into contact and merge. Depending on the component masses, the merger can lead to a supernova of type Ia or result in a massive white dwarf. In the latter case, the white dwarf remnant is expected to be highly magnetised because of the strong magnetic dynamo that should arise during the merger, and be rapidly spinning from the conservation of the orbital angular momentum. Here we report observations of a white dwarf, ZTF J190132.9+145808.7, that exhibits these properties, but to an extreme: a rotation period of 6.94 minutes, a magnetic field ranging between 600 megagauss and 900 megagauss over its surface, and a stellar radius of about 2,100 km, slightly larger than the radius of the Moon. Such a small radius implies that the stars mass is close to the maximum white-dwarf mass, or Chandrasekhar mass. ZTF J190132.9+145808.7 is likely to be cooling through the Urca processes (neutrino emission from electron capture on sodium) because of the high densities reached in its core.