Ultracompact dwarf galaxies (UCDs) are among the densest stellar systems in the universe. These systems have masses up to 200 million solar masses, but half light radii of just 3-50 parsecs. Dynamical mass estimates show that many UCDs are more massive than expected from their luminosity. It remains unclear whether these high dynamical mass estimates are due to the presence of supermassive black holes or result from a non-standard stellar initial mass function that causes the average stellar mass to be higher than expected. Here we present the detection of a supermassive black hole in a massive UCD. Adaptive optics kinematic data of M60-UCD1 show a central velocity dispersion peak above 100 km/s and modest rotation. Dynamical modeling of these data reveals the presence of a supermassive black hole with mass of 21 million solar masses. This is 15% of the objects total mass. The high black hole mass and mass fraction suggest that M60-UCD1 is the stripped nucleus of a galaxy. Our analysis also shows that M60-UCD1s stellar mass is consistent with its luminosity, implying many other UCDs may also host supermassive black holes. This suggests a substantial population of previously unnoticed supermassive black holes.