Special attention has been paid to the organic afterglow materials (OAM) for their fascinating properties. However, poor stability at air and complicated structure design hinder the development of OAM. Herein, sol-gel, a facile and simple technique, is employed to synthesize a series of organic/inorganic hybrid nanocomposites (N1/SiO2, N2/SiO2, and N3/SiO2) by covalently linking three common aryl imides with crosslinked silica skeleton. These nanomaterials show excitation wavelength-dependent and colorful (yellow, red and green) afterglow of organic imides with long lifetime up to 1.1 s at air. Interestingly, the ultralong phosphorescence is ultrastable under various conditions: water, high temperature, UV irradiation and in vivo , due to the protection of inorganic silica. In particularly, heating to 500 oC does not quench the afterglow of organic luminophore in nanocomposites, but forms new ultralong phosphorescence originated from space-conjugation of silica and carbonyl. The afterglow nanomaterials display huge advantages in the applications of advanced anti-counterfeiting and bioimaging.