Pneumocystis pneumonia (PCP) is an opportunistic, infectious disease that is prevalent in immunosuppressed hosts. Corticosteroid treatment is the most significant risk factor for patients with PCP who are human immunodeficiency virus negative, although little is known about how corticosteroids alter the host defense against Pneumocystis infection. In the present study, we used transcriptome analysis to examine the immune response in the lungs of corticosteroid-treated PCP mice. The results showed down-regulation in the genes related to both native immunity, such as antigen processing and presentation, inflammatory response, and phagocytosis, as well as B and T lymphocyte immunity. The repression of gene expression, corresponding to B cell immunity, including B cell signaling, homeostasis, and Ig production, was prominent. The finding was confirmed by quantitative PCR of mouse lungs and the peripheral blood of patients with PCP. Flow cytometry also revealed a significant depletion of B cells in corticosteroid-treated PCP mice. Our study has highlighted that corticosteroid treatment suppresses the B cell immunity in the PCP host, which is likely one of the main reasons that corticosteroid treatment may stimulate PCP development.