Edible fruits, such as that of the tomato plant and other vegetable crops, are markedly diverse in shape and size. SUN, one of the major genes controlling the elongated fruit shape of tomato, was positionally cloned and found to encode a member of the IQ67 domain-containing family. We show that the locus arose as a result of an unusual 24.7-kilobase gene duplication event mediated by the long terminal repeat retrotransposon Rider. This event resulted in a new genomic context that increased SUN expression relative to that of the ancestral copy, culminating in an elongated fruit shape. Our discovery demonstrates that retrotransposons may be a major driving force in genome evolution and gene duplication, resulting in phenotypic change in plants.