Purpose The length of time a critically ill coronavirus disease 2019 (COVID-19) patient remains infectious and should therefore be isolated remains unknown. This prospective study was undertaken in critically ill patients to evaluate the reliability of single negative real-time polymerase chain reaction (RT-PCR) in lower tracheal aspirates (LTA) in predicting a second negative test and to analyze clinical factors potentially influencing the viral shedding. Methods From April 9, 2020 onwards, intubated COVID-19 patients treated in the intensive care unit were systematically evaluated for severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) by RT-PCR of nasopharyngeal swabs and LTA. The time to negativity was defined as the time between the onset of symptoms and the viral clearance in LTA. In order to identify risk factors for prolonged viral shedding, we used univariate and multivariate Cox proportional hazards models. Results Forty-eight intubated SARS-CoV-2 patients were enrolled. Overall, we observed that the association of the first negative RT-PCR with a second negative result was 96.7%. Median viral shedding was 25 (IQR: 21.5-28) days since symptoms' onset. In the univariate Cox model analysis, type 2 diabetes mellitus was associated with a prolonged viral RNA shedding (hazard ratio [HR]: 0.41, 95% CI: 0.06-3.11, p = 0.04). In the multivariate Cox model analysis, type 2 diabetes was associated with a prolonged viral RNA shedding (HR: 0.31, 95% CI: 0.11-0.89, p = 0.029). Conclusion Intubated patients with type 2 diabetes mellitus may have prolonged SARS-CoV-2 shedding. In critically ill COVID-19 patients, one negative LTA should be sufficient to assess and exclude infectivity.