Bacterial infections are one of the most serious health risks worldwide, and their rapid diagnosis remains a major challenge in clinic. To enhance the relaxivity and bacterial specificity of magnetic resonance imaging (MRI) contrast agents, here, a kind of gadolinium-based nanoparticles (NPs) of impressive biocompatibility is constructed as a contrast agent for maltodextrinmediated bacteria-targeted diagnosis. To realize this, positively charged ultrasmall gadolinium oxide (Gd 2 O 3 , 2−3 nm) NPs are embedded in mesoporous silica NPs (MSN) with pore size around 6.38 nm. The resulting Gd 2 O 3 @MSN exhibits enhanced r 1 value and T 1 -weighted MRI performance. Interestingly, upon conjugation of Gd 2 O 3 @MSN with maltodextrin to produce Gd 2 O 3 @MSN-Malt NPs, a remarkable decrease in internalization by osteosarcoma cells, alongside an increased adsorption toward E. coli and S. aureus, is achieved. It is therefore conceivable that the bacteria-targeted Gd 2 O 3 @MSN-Malt might be a promising MRI contrast agent for effective discrimination of bacterial infections from tumor.