Cellular senescence is involved in diverse physiological processes. Accumulation of senescent cells can lead to numerous age-related diseases. Therefore, it is of great significance to develop chemical tools to effectively detect and eliminate senescent cells. Till date, a dual functional probe that could detect and eliminate senescent cells has yet been accomplished. Herein, a β-gal-activated probe, MB-βgal, based on the methylene blue (MB) fluorophore, was designed to detect and eliminate senescent cells. In the absence of β-gal, the probe showed no fluorescence and its 1O2 production efficiency was suppressed simultaneously. On the other hand, MB-βgal could be specifically activated by the high level of β-gal in senescent cells, thus, releasing free MB with near-infrared (NIR) fluorescence and high 1O2 production efficiency under light irradiation. MB-βgal demonstrated a fast response, high sensitivity, and high selectivity in detecting β-gal in an aqueous solution and was further applied to visualization and ablation of senescent cells. As a proof of concept, the dual functions of MB-βgal were successfully demonstrated in senescent HeLa cells and mouse embryonic fibroblast cells.