Most ultraluminous X-ray sources1 have a typical set of properties not seen in Galactic stellar-mass black holes. They have luminosities of more than 3 × 1039 ergs per second, unusually soft X-ray components (with a typical temperature of less than about 0.3 kiloelectronvolts) and a characteristic downturn2, 3 in their spectra above about 5 kiloelectronvolts. Such puzzling properties have been interpreted either as evidence of intermediate-mass black holes4, 5 or as emission from stellar-mass black holes accreting above their Eddington limit6, 7, analogous to some Galactic black holes at peak luminosity8, 9. Recently, a very soft X-ray spectrum was observed in a rare and transient stellar-mass black hole10. Here we report that the X-ray source P13 in the galaxy NGC 779311 is in a binary system with a period of about 64 days and exhibits all three canonical properties of ultraluminous sources. By modelling the strong optical and ultraviolet modulations arising from X-ray heating of the B9Ia donor star, we constrain the black hole mass to be less than 15 solar masses. Our results demonstrate that in P13, soft thermal emission and spectral curvature are indeed signatures of supercritical accretion. By analogy, ultraluminous X-ray sources with similar X-ray spectra and luminosities of up to a few times 1040 ergs per second can be explained by supercritical accretion onto massive stellar-mass black holes.