Most massive galaxies have supermassive black holes at their centres, and the masses of the black holes are believed to correlate with properties of the host-galaxy bulge component. Several explanations have been proposed for the existence of these locally established empirical relationships, including the non-causal, statistical process of galaxy-galaxy merging, direct feedback between the black hole and its host galaxy, and galaxy-galaxy merging and the subsequent violent relaxation and dissipation. The empirical scaling relations are therefore important for distinguishing between various theoretical models of galaxy evolution, and they furthermore form the basis for all black-hole mass measurements at large distances. Observations have shown that the mass of the black hole is typically 0.1 per cent of the mass of the stellar bulge of the galaxy. Until now, the galaxy with the largest known fraction of its mass in its central black hole (11 per cent) was the small galaxy NGC 4486B. Here we report observations of the stellar kinematics of NGC 1277, which is a compact, lenticular galaxy with a mass of 1.2 × 1011 solar masses. From the data, we determine that the mass of the central black hole is 1.7 × 1010 solar masses, or 59 per cent of its bulge mass. We also show observations of five other compact galaxies that have properties similar to NGC 1277 and therefore may also contain over-massive black holes. It is not yet known if these galaxies represent a tail of a distribution, or if disk-dominated galaxies fail to follow the usual black-hole mass scaling relations.