Case presentationA 6-month-old male child developed acute pneumonia and sepsis. This child had previously suffered from Escherichia coli septicemia and was cured. However, the fever and dyspnea relapsed. Blood tests revealed a low lymphocyte count (0.69 × 109/L) and acute inflammatory markers such as high-level procalcitonin (8.0 ng/ml) and C-reactive protein (19 mg/dl). Chest imaging showed inflammation and decreased translucency in both lungs but no thymus shadow. Various serology tests, the 1,3-beta-D-glucan test, culture, as well as sputum smear failed to detect any pathogens. mNGS with blood helped identify 133 specific nucleic acid sequences of Pneumocystis jirovecii, suggesting an infection with this pathogen. After treatment with trimethoprim-sulfamethoxazole for 5 days, the patient's condition improved, but the child still needed ventilator support. Unfortunately, the child died soon after because of respiratory failure after his parents decided to abandon treatment. The family declined an autopsy on the child, and therefore, an anatomical diagnosis could not be obtained. Whole-exome sequencing suggested X-linked immunodeficiency. A hemizygous mutation of c.865c > t (p.r289*) was detected in the IL2RG gene, which was inherited from the mother (heterozygous state).