SUMMARY Identification of the events responsible for rapid morphological variation during evolution can help understand how developmental processes are changed by genetic modifications and thus produce diverse body features and shapes. Sex combs, a sexually dimorphic structure, show considerable variation in morphology and numbers among males from related species of Sophophora, a subgenus of Drosophila. To address which evolutionary changes in developmental processes underlie this diversity, we first analyzed the genetic network that controls morphogenesis of a single sex comb in the model D. melanogaster. We show that it depends on positive and negative regulatory inputs from proximo-distal identity specifying genes, including dachshund, bric à brac, and sex combs distal. All contribute to spatial regulation of the Hox gene Sex combs reduced (Scr), which is crucial for comb formation. We next analyzed the expression of these genes in sexually dimorphic species with different comb numbers. Only Scr shows considerable expression plasticity, which is correlated with comb number variation in these species. We suggest that differences in comb numbers reflect changes of Scr expression in tarsus primordia, and discuss how initial comb formation could have occurred in an ancestral Sophophora fly following regulatory modifications of developmental programs both parallel to and downstream of Scr.