Pneumocystis jirovecii pneumonia (PcP) has for many years been reported mostly in human immunodeficiency virus-infected patients. Increasingly, it also affects other immunocompromised patients, e.g. after organ or allogeneic stem cell/bone marrow transplantation, patients with hematologic malignancies or autoimmune diseases. The diagnosis of PcP relies on a critical evaluation of clinical symptoms, risk factors, radiologic features and microbiological tests. High dose cotrimoxazole is the most effective therapeutic option. Rapid initiation is essential, since mortality is especially high in patients admitted to intensive care with respiratory failure. This article reviews the current epidemiology of PcP and highlights the diagnostic and therapeutic options. Recommendations for primary and secondary prophylaxis are summarized.