Conventional polymerase chain reaction (PCR) in respiratory samples does not differentiate between Pneumocystis pneumonia (PCP) and Pneumocystis jirovecii ( Pj) colonization. We used Pj real-time quantitative PCR (qPCR) with the objective to discriminate PCP from Pj colonization in immunocompromised patients. All positive Pj qPCR [targeting the major surface glycoprotein (MSG) gene] obtained in respiratory samples from immunocompromised patients presenting pneumonia at the Grenoble University Hospital, France, were collected between August 2009 and April 2011. Diagnoses were retrospectively determined by a multidisciplinary group of experts blinded to the Pj qPCR results. Thirty-one bronchoalveolar lavages and four broncho aspirations positive for the Pj qPCR were obtained from 35 immunocompromised patients. Diagnoses of definite, probable, and possible PCP, and pneumonia from another etiology were retrospectively made for 7, 4, 5, and 19 patients, respectively. Copy numbers were significantly higher in the “definite group” (median 465,000 copies/ml) than in the “probable group” (median 38,600 copies/ml), the “possible group” (median 1,032 copies/ml), and the “other diagnosis group” (median 390 copies/ml). With the value of 3,160 copies/ml, the sensitivity and specificity of qPCR for the diagnosis of PCP were 100 % and 70 %, respectively. With the value of 31,600 copies/ml, the sensitivity and specificity were 80 % and 100 %, respectively. The positive predictive value was 100 % for results with more than 31,600 copies/ml and the negative predictive value was 100 % for results with fewer than 3,160 copies/ml. qPCR targeting the MSG gene can be helpful to discriminate PCP from Pj colonization in immunocompromised patients, using two cut-off values, with a gray zone between them.