Abstract Developing dynamic and highly sensitive methods for imaging M2‐type tumor‐associated macrophages (TAMs) is vital for monitoring the tumor progression and assessing the therapeutic efficacy. Here, the fabrication and application of rationally designed Er‐based rare‐earth nanoprobes for the targeted imaging of M2‐type TAMs in glioblastoma (GBM) through the second near‐infrared (NIR‐II) fluorescence beyond 1500 nm is reported. The NIR‐IIb fluorescence of Er‐based rare‐earth nanoparticles can be remarkably enhanced by optimizing their core‐shell structures and the shell thickness, which allows for in vivo imaging under excitation by a 980 nm laser with the lowest power density (40 mW cm ‐2 ). These bright Er‐based nanoparticles functionalized with M2pep polypeptide show notable targeting ability to M2‐type macrophages, which has been well tested in both in vitro and in vivo experiments by their up‐conversion (UC) fluorescence (540 nm) and down‐shifting (DS) fluorescence (1525 nm), respectively. The targeting capability of these nanoprobes in vivo is also demonstrated by the overlap of immunofluorescence of M2‐type TAMs and Arsenazo III staining of rare‐earth ions in tumor tissue. It is envisioned that these nanoprobes can serve as a companion diagnostic tool to dynamically assess the progression and prognosis of GBM.