Acute Lung Injury (ALI) due to inhaled pathogens causes high mortality. Underlying mechanisms are inadequately understood. Here, by optical imaging of live mouse lungs we show that a key mechanism is the viability of cytosolic Ca2+ buffering by the mitochondrial Ca2+ uniporter (MCU) in the lung’s surfactant-secreting, alveolar type 2 cells (AT2). The buffering increased mitochondrial Ca2+ and induced surfactant secretion in wild-type mice, but not in mice with AT2-specific MCU knockout. In the knockout mice, ALI due to intranasal LPS instillation caused severe pulmonary edema and mortality, which were mitigated by surfactant replenishment prior to LPS instillation, indicating surfactant’s protective effect against alveolar edema. In wild-type mice, intranasal LPS, or Pseudomonas aeruginosa decreased AT2 MCU. Loss of MCU abrogated buffering. The resulting mortality was reduced by spontaneous recovery of MCU expression, or by MCU replenishment. Enhancement of AT2 mitochondrial buffering, hence endogenous surfactant secretion, through MCU replenishment might be a therapy against ALI.