BACKGROUNDDespite guidelines promoting the prevention and aggressive treatment of ventilator-associated pneumonia (VAP), the importance of VAP as a driver of outcomes in mechanically ventilated patients, including patients with severe COVID-19, remains unclear. We aimed to determine the contribution of unsuccessful treatment of VAP to mortality for patients with severe pneumonia.METHODSWe performed a single-center, prospective cohort study of 585 mechanically ventilated patients with severe pneumonia and respiratory failure, 190 of whom had COVID-19, who underwent at least 1 bronchoalveolar lavage. A panel of intensive care unit (ICU) physicians adjudicated the pneumonia episodes and endpoints on the basis of clinical and microbiological data. Given the relatively long ICU length of stay (LOS) among patients with COVID-19, we developed a machine-learning approach calledCarpeDiem, which grouped similar ICU patient-days into clinical states based on electronic health record data.RESULTSCarpeDiemrevealed that the long ICU LOS among patients with COVID-19 was attributable to long stays in clinical states characterized primarily by respiratory failure. While VAP was not associated with mortality overall, the mortality rate was higher for patients with 1 episode of unsuccessfully treated VAP compared with those with successfully treated VAP (76.4% versus 17.6%,P< 0.001). For all patients, including those with COVID-19,CarpeDiemdemonstrated that unresolving VAP was associated with a transitions to clinical states associated with higher mortality.CONCLUSIONSUnsuccessful treatment of VAP is associated with higher mortality. The relatively long LOS for patients with COVID-19 was primarily due to prolonged respiratory failure, placing them at higher risk of VAP.FUNDINGNational Institute of Allergy and Infectious Diseases (NIAID), NIH grant U19AI135964; National Heart, Lung, and Blood Institute (NHLBI), NIH grants R01HL147575, R01HL149883, R01HL153122, R01HL153312, R01HL154686, R01HL158139, P01HL071643, and P01HL154998; National Heart, Lung, and Blood Institute (NHLBI), NIH training grants T32HL076139 and F32HL162377; National Institute on Aging (NIA), NIH grants K99AG068544, R21AG075423, and P01AG049665; National Library of Medicine (NLM), NIH grant R01LM013337; National Center for Advancing Translational Sciences (NCATS), NIH grant U01TR003528; Veterans Affairs grant I01CX001777; Chicago Biomedical Consortium grant; Northwestern University Dixon Translational Science Award; Simpson Querrey Lung Institute for Translational Science (SQLIFTS); Canning Thoracic Institute of Northwestern Medicine.