Lanthanide-doped glasses and crystals are attractive for laser applications because the metastable energy levels of the trivalent lanthanide ions facilitate the establishment of population inversion and amplified stimulated emission at relatively low pump power(1-3). At the nanometre scale, lanthanide-doped upconversion nanoparticles (UCNPs) can now be made with precisely controlled phase, dimension and doping level(4,5). When excited in the near-infrared, these UCNPs emit stable, bright visible luminescence at a variety of selectable wavelengths(6-9), with single-nanoparticle sensitivity(10-13), which makes them suitable for advanced luminescence microscopy applications. Here we show that UCNPs doped with high concentrations of thulium ions (Tm3+), excited at a wavelength of 980 nanometres, can readily establish a population inversion on their intermediate metastable H-3(4) level: the reduced inter-emitter distance at high Tm3+ doping concentration leads to intense cross-relaxation, inducing a photon-avalanche-like effect that rapidly populates the metastable H-3(4) level, resulting in population inversion relative to the H-3(6) ground level within a single nanoparticle. As a result, illumination by a laser at 808 nanometres, matching the upconversion band of the H-3(4)-> H-3(6) transition, can trigger amplified stimulated emission to discharge the H-3(4) intermediate level, so that the upconversion pathway to generate blue luminescence can be optically inhibited. We harness these properties to realize low-power super-resolution stimulated emission depletion (STED) microscopy and achieve nanometre-scale optical resolution (nanoscopy), imaging single UCNPs; the resolution is 28 nanometres, that is, 1/36th of the wavelength. These engineered nanocrystals offer saturation intensity two orders of magnitude lower than those of fluorescent probes currently employed in stimulated emission depletion microscopy, suggesting a new way of alleviating the square-root law that typically limits the resolution that can be practically achieved by such techniques.