Sorghum (Sorghum bicolor) is the fifth most popular crop worldwide and a C4 model plant. Domesticated sorghum comes in many forms, including sweet cultivars with juicy stems and grain sorghum with dry, pithy stems at maturity. The Dry locus, which controls the pithy/juicy stem trait, was discovered over a century ago. Here, we found that Dry gene encodes a plant-specific NAC transcription factor. Dry was either deleted or acquired loss-of-function mutations in sweet sorghum, resulting in cell collapse and altered secondary cell wall composition in the stem. Twenty-three Dry ancestral haplotypes, all with dry, pithy stems, were found among wild sorghum and wild sorghum relatives. Two of the haplotypes were detected in domesticated landraces, with four additional dry haplotypes with juicy stems detected in improved lines. These results imply that selection for Dry gene mutations was a major step leading to the origin of sweet sorghum. The Dry gene is conserved in major cereals; fine-tuning its regulatory network could provide a molecular tool to control crop stem texture.