Regulated by pH, membrane-anchored proteins E and M function during dengue virus maturation and membrane fusion. Our atomic model of the whole virion from cryo-electron microscopy at 3.5-Å resolution reveals that in the mature virus at neutral extracellular pH, the N-terminal 20-amino-acid segment of M (involving three pH-sensing histidines) latches and thereby prevents spring-loaded E fusion protein from prematurely exposing its fusion peptide. This M latch is fastened at an earlier stage, during maturation at acidic pH in the trans-Golgi network. At a later stage, to initiate infection in response to acidic pH in the late endosome, M releases the latch and exposes the fusion peptide. Thus, M serves as a multistep chaperone of E to control the conformational changes accompanying maturation and infection. These pH-sensitive interactions could serve as targets for drug discovery.