The nanosensors based on gold nanoparticles functionalized with lanthanide complexes were synthesized. The nanosensors selectively and sensitively detected DPA, a biomarker of bacterial spores. Ratiometric sensing of DPA by a ternary complex was achieved by ligand displacement strategy.