The tremendous pandemic potential of coronaviruses was demonstrated twice in the past few decades by two global outbreaks of deadly pneumonia. The coronavirus spike (S) glycoprotein initiates infection by promoting fusion of the viral and cellular membranes through conformational changes that remain largely uncharacterized. Here we report the cryoEM structure of a coronavirus S glycoprotein in the postfusion state, showing large-scale secondary, tertiary, and quaternary rearrangements compared with the prefusion trimer and rationalizing the free-energy landscape of this conformational machine. We also biochemically characterized the molecular events associated with refolding of the metastable prefusion S glycoprotein to the postfusion conformation using limited proteolysis, mass spectrometry, and single-particle EM. The observed similarity between postfusion coronavirus S and paramyxovirus F structures demonstrates that a conserved refolding trajectory mediates entry of these viruses and supports the evolutionary relatedness of their fusion subunits. Finally, our data provide a structural framework for understanding the mode of neutralization of antibodies targeting the fusion machinery and for engineering next-generation subunit vaccines or inhibitors against this medically important virus family.