Previous studies have noted that persons living with human immunodeficiency virus (HIV) experience persistent lung dysfunction after an episode of community-acquired pneumonia (CAP), although the underlying mechanisms remain unclear. We hypothesized that inflammation during pneumonia triggers increased tissue damage and accelerated pulmonary fibrosis, resulting in a gradual loss of lung function. We carried out a prospective cohort study of people diagnosed with CAP and/or HIV between 2016 and 2018 in three clinical institutions in Medellín, Colombia. Clinical data, blood samples, and pulmonary function tests (PFTs) were collected at baseline. Forty-one patients were included, divided into two groups: HIV and CAP (n = 17) and HIV alone (n = 24). We compared the concentrations of 17 molecules and PFT values between the groups. Patients with HIV and pneumonia presented elevated levels of cytokines and chemokines (IL-6, IL-8, IL-18, IL-1RA, IL-10, IP-10, MCP-1, and MIP-1β) compared to those with only HIV. A marked pulmonary dysfunction was evidenced by significant reductions in FEF25, FEF25-75, and FEV1. The correlation between these immune mediators and lung function parameters supports the connection between pneumonia-associated inflammation and end organ lung dysfunction. A low CD4 cell count (<200 cells/μL) predicted inflammation and lung dysfunction. These results underscore the need for targeted clinical approaches to mitigate the adverse impacts of CAP on lung function in this population.