Microbial lung infections are the major cause of morbidity and mortality in the hereditary metabolic disorder cystic fibrosis, yet the molecular mechanisms leading from the mutation of cystic fibrosis transmembrane conductance regulator (CFTR) to lung infection are still unclear. Here, we show that ceramide age-dependently accumulates in the respiratory tract of uninfected Cftr-deficient mice owing to an alkalinization of intracellular vesicles in Cftr-deficient cells. This change in pH results in an imbalance between acid sphingomyelinase (Asm) cleavage of sphingomyelin to ceramide and acid ceramidase consumption of ceramide, resulting in the higher levels of ceramide. The accumulation of ceramide causes Cftr-deficient mice to suffer from constitutive age-dependent pulmonary inflammation, death of respiratory epithelial cells, deposits of DNA in bronchi and high susceptibility to severe Pseudomonas aeruginosa infections. Partial genetic deficiency of Asm in Cftr(-/-)Smpd1(+/-) mice or pharmacological treatment of Cftr-deficient mice with the Asm blocker amitriptyline normalizes pulmonary ceramide and prevents all pathological findings, including susceptibility to infection. These data suggest inhibition of Asm as a new treatment strategy for cystic fibrosis.