Real-time navigation of nanorobots with high spatiotemporal resolution and molecular contrast in deep tissues via noninvasive manners has been challenging. Here, we developed near-infrared II (NIR-II; 1000 to 3000 nanometers) magnetic nanorobots that balance fluorescence brightness at ~1600 nanometers with magnetic strength, facilitating precise gathering or locomotion of the nanorobots in the peritoneal cavity, hindlimb, liver, spleen, and lower gastrointestinal tract of live mice under real-time NIR-II imaging guidance with high resolution and sensitivity. Two-plex NIR-II imaging enabled precise locomotion by simultaneously providing real-time information on both the location of nanorobots and the position of target sites with molecular specificity. NIR-II magnetic nanorobots remained stable in gastric juice simulated solution (pH = 2) for more than 2 weeks. The magnetic locomotion of nanorobots loaded with 5-aminosalicylic acid under NIR-II visual feedback enables targeted delivery to the lower gastrointestinal tract and effectively enhances therapeutic efficacy in mice with inflammatory bowel disease. This platform opens an avenue in precision medicine.