Plants evolved so that their flowering is triggered by seasonal changes in day length. However, day-length sensitivity in crops limits their geographical range of cultivation, and thus modification of the photoperiod response was critical for their domestication. Here we show that loss of day-length-sensitive flowering in tomato was driven by the florigen paralog and flowering repressor SELF-PRUNING 5G (SP5G). SP5G expression is induced to high levels during long days in wild species, but not in cultivated tomato because of cis-regulatory variation. CRISPR/Cas9-engineered mutations in SP5G cause rapid flowering and enhance the compact determinate growth habit of field tomatoes, resulting in a quick burst of flower production that translates to an early yield. Our findings suggest that pre-existing variation in SP5G facilitated the expansion of cultivated tomato beyond its origin near the equator in South America, and they provide a compelling demonstration of the power of gene editing to rapidly improve yield traits in crop breeding.