To evaluate the diagnostic value and clinical application of metagenomic next-generation sequencing (mNGS) for infections in critically ill patients. Comparison of diagnostic performance of mNGS and conventional microbiological testing for pathogens was analyzed in 234 patients. The differences between immunocompetent and immunocompromised individuals in mNGS-guided anti-infective treatment adjustment were also analyzed. The sensitivity and specificity of mNGS for bacterial and fungal detection were 96.6% (95% confidence interval [CI], 93.5%-99.6%) and 83.1% (95% CI, 75.2%-91.1%), and 85.7% (95% CI, 71.9%-99.5%) and 93.2% (95% CI, 89.7%-96.7%), respectively. Overall, 152 viruses were detected by mNGS, but in which 28 viruses were considered causative agents. The proportion of mNGS-guided beneficial anti-infective therapy adjustments in the immunocompromised group was greater than in the immunocompetent group (48.5% vs 30.1%; P=0.008). In addition, mNGS-guided anti-infective regimens with peripheral blood and BALF specimens had the highest proportion (39.0%; 40.0%), but the proportion of patients not helpful due to peripheral blood mNGS was also as high as 22.0%. mNGS might be a promising technology to provide precision medicine for critically ill patients with infection.