Fluorescent probes for the detection of acid phosphatases (ACP) are important in the investigation of the pathology and diagnosis of diseases. We reported a lysosome-targeted near-infrared (NIR) fluorescent probe SHCy-P based on a novel NIR-emitting thioxanthene-indolium dye for the detection of ACP. The probe showed a long wavelength fluorescence emission at λem = 765 nm. Due to the ACP-catalyzed cleavage of the phosphate group in SHCy-P, the probe exhibited high selectivity and sensitivity for the 'turn-on' detection of ACP with a limit of detection as low as 0.48 U L-1. The probe SHCy-P could also be used to detect and image endogenous ACP in lysosomes. In light of these prominent properties, we envision that SHCy-P will be an efficient optical imaging approach for investigating the ACP activity in disease diagnosis.