The clinical potentials of radiotherapy could not be achieved completely because of the inaccurate positioning and inherent radioresistance of tumours. In this study, a novel active-targeting upconversion theranostic agent (arginine-glycine-aspartic acid-labelled BaYbF5: 2% Er(3+) nanocube) was developed for the first time to address these clinical demands. Heavy metal-based nanocubes (~10 nm) are potential theranostic agents with bifunctional features: computed tomography (CT) contrast agents for targeted tumour imaging and irradiation dose enhancers in tumours during radiotherapy. Remarkably, they showed low toxicity and excellent performance in active-targeting CT imaging and CT imaging-guided radiosensitizing therapy, which could greatly concentrate and enlarge the irradiation dose deposition in tumours to enhance therapeutic efficacy and minimize the damage to surrounding tissues.