Stellar superflares are energetic outbursts of electromagnetic radiation that are similar to solar flares but release more energy, up to 1036 erg on main-sequence stars. It is unknown whether the Sun can generate superflares and, if so, how often they might occur. We used photometry from the Kepler space observatory to investigate superflares on other stars with Sun-like fundamental parameters. We identified 2889 superflares on 2527 Sun-like stars, out of 56,450 observed. This detection rate indicates that superflares with energies >1034 erg occur roughly once per century on stars with Sun-like temperature and variability. The resulting stellar superflare frequency-energy distribution is consistent with an extrapolation of the Sun's flare distribution to higher energies, so we suggest that both are generated by the same physical mechanism.