All-solid-state batteries with a Li anode and ceramic electrolyte have the potential to deliver a step change in performance compared with today's Li-ion batteries1,2. However, Li dendrites (filaments) form on charging at practical rates and penetrate the ceramic electrolyte, leading to short circuit and cell failure3,4. Previous models of dendrite penetration have generally focused on a single process for dendrite initiation and propagation, with Li driving the crack at its tip5-9. Here we show that initiation and propagation are separate processes. Initiation arises from Li deposition into subsurface pores, by means of microcracks that connect the pores to the surface. Once filled, further charging builds pressure in the pores owing to theslow extrusion of Li (viscoplastic flow) back to the surface, leading to cracking. By contrast, dendrite propagation occurs by wedge opening, with Li driving the dry crack from the rear, not the tip. Whereas initiation is determined by the local (microscopic) fracture strength at the grain boundaries, the pore size, pore population density and current density, propagation depends on the (macroscopic) fracture toughness of the ceramic, the length of the Li dendrite (filament) that partially occupies the dry crack, current density, stack pressure and the charge capacity accessed during each cycle. Lower stack pressures suppress propagation, markedly extending the number of cycles before short circuit in cells in which dendrites have initiated.