Some patients infected with severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) develop severe pneumonia and acute respiratory distress syndrome1 (ARDS). Distinct clinical features in these patients have led to speculation that the immune response to virus in the SARS-CoV-2-infected alveolus differs from that in other types of pneumonia2. Here we investigate SARS-CoV-2 pathobiology by characterizing the immune response in the alveoli of patients infected with the virus. We collected bronchoalveolar lavage fluid samples from 88 patients with SARS-CoV-2-induced respiratory failure and 211 patients with known or suspected pneumonia from other pathogens, and analysed them using flow cytometry and bulk transcriptomic profiling. We performed single-cell RNA sequencing on 10 bronchoalveolar lavage fluid samples collected from patients with severe coronavirus disease 2019 (COVID-19) within 48 h of intubation. In the majority of patients with SARS-CoV-2 infection, the alveolar space was persistently enriched in T cells and monocytes. Bulk and single-cell transcriptomic profiling suggested that SARS-CoV-2 infects alveolar macrophages, which in turn respond by producing T cell chemoattractants. These T cells produce interferon-γ to induce inflammatory cytokine release from alveolar macrophages and further promote T cell activation. Collectively, our results suggest that SARS-CoV-2 causes a slowly unfolding, spatially limited alveolitis in which alveolar macrophages containing SARS-CoV-2 and T cells form a positive feedback loop that drives persistent alveolar inflammation.