One of the most rapidly growing areas of physics and nanotechnology focuses on plasmonic effects on the nanometre scale, with possible applications ranging from sensing and biomedicine to imaging and information technology. However, the full development of nanoplasmonics is hindered by the lack of devices that can generate coherent plasmonic fields. It has been proposed that in the same way as a laser generates stimulated emission of coherent photons, a 'spaser' could generate stimulated emission of surface plasmons (oscillations of free electrons in metallic nanostructures) in resonating metallic nanostructures adjacent to a gain medium. But attempts to realize a spaser face the challenge of absorption loss in metal, which is particularly strong at optical frequencies. The suggestion to compensate loss by optical gain in localized and propagating surface plasmons has been implemented recently and even allowed the amplification of propagating surface plasmons in open paths. Still, these experiments and the reported enhancement of the stimulated emission of dye molecules in the presence of metallic nanoparticles lack the feedback mechanism present in a spaser. Here we show that 44-nm-diameter nanoparticles with a gold core and dye-doped silica shell allow us to completely overcome the loss of localized surface plasmons by gain and realize a spaser. And in accord with the notion that only surface plasmon resonances are capable of squeezing optical frequency oscillations into a nanoscopic cavity to enable a true nanolaser, we show that outcoupling of surface plasmon oscillations to photonic modes at a wavelength of 531 nm makes our system the smallest nanolaser reported to date-and to our knowledge the first operating at visible wavelengths. We anticipate that now it has been realized experimentally, the spaser will advance our fundamental understanding of nanoplasmonics and the development of practical applications.