The development of precision nanomedicines to direct nanostructure-based reagents into tumour-targeted areas remains a critical challenge in clinics. Chemical reaction-mediated localization in response to tumour environmental perturbations offers promising opportunities for rational design of effective nano-theranostics. Here, we present a unique microenvironment-sensitive strategy for localization of peptide-premodified upconversion nanocrystals (UCNs) within tumour areas. Upon tumour-specific cathepsin protease reactions, the cleavage of peptides induces covalent cross-linking between the exposed cysteine and 2-cyanobenzothiazole on neighbouring particles, thus triggering the accumulation of UCNs into tumour site. Such enzyme-triggered cross-linking of UCNs leads to enhanced upconversion emission upon 808 nm laser irradiation, and in turn amplifies the singlet oxygen generation from the photosensitizers attached on UCNs. Importantly, this design enables remarkable tumour inhibition through either intratumoral UCNs injection or intravenous injection of nanoparticles modified with the targeting ligand. Our strategy may provide a multimodality solution for effective molecular sensing and site-specific tumour treatment.