Abstract Afterglow imaging with long-lasting luminescence after cessation of light excitation provides opportunities for ultrasensitive molecular imaging; however, the lack of biologically compatible afterglow agents has impeded exploitation in clinical settings. This study presents a generic approach to transforming ordinary optical agents (including fluorescent polymers, dyes, and inorganic semiconductors) into afterglow luminescent nanoparticles (ALNPs). This approach integrates a cascade photoreaction into a single-particle entity, enabling ALNPs to chemically store photoenergy and spontaneously decay it in an energy-relay process. Not only can the afterglow profiles of ALNPs be finetuned to afford emission from visible to near-infrared (NIR) region, but also their intensities can be predicted by a mathematical model. The representative NIR ALNPs permit rapid detection of tumors in living mice with a signal-to-background ratio that is more than three orders of magnitude higher than that of NIR fluorescence. The biodegradability of the ALNPs further heightens their potential for ultrasensitive in vivo imaging.