Objective:To assess the impact of pastPneumocystis jiroveciipneumonia (PJP) on the pulmonary diffusion capacity in people with HIV (PWH) with a history of advanced immunodeficiency.Design:Prospective cross-sectional study.Methods:Adult PWH with past PJP >1 year ago were included as the study group. The control group consisted of PWH with a nadir CD4+lymphocyte count <200 cells/mm3, matched by age, sex, smoking status and time since HIV diagnosis. All PWH completed a pulmonary function test (PFT) consisting of pre-bronchodilation spirometry, body plethysmography and single-breath carbon monoxide transfer factor (TLCO) measurement. TLCO, diffusion impairment (defined as a TLCOZ-score <−1.645), total lung capacity (TLC) and forced expiratory volume in one second/forced vital capacity (FEV1/FVC)Z-scores were assessed. Multivariable regression analyses were conducted withZ-scores and odds of diffusion impairment as outcomes.Results:PFTs of 102 participants were analyzed, 51 of whom had past PJP with a median of 10 years since PJP. Mean TLCOZ-score and diffusion impairment rate did not differ significantly between groups (P= 0.790;P= 0.650). Past PJP was not independently associated with TLCOZ-score [β= 0.14; 95% confidence interval (CI) −0.30–0.57], diffusion impairment (odds ratio 1.00; 95% CI 0.36–2.75) nor TLC or FEV1/FVCZ-scores, whereas current (vs. never) smoking was associated with more diffusion impairment and lower TLCOZ-scores.Conclusion:In our study, past PJP was not associated with long-term diffusion impairment. Our findings suggest that smoking plays a more important role in persistent pulmonary function impairment whereas PJP-related changes seem to be reversible.