Using genomic information from mosquito, red flour beetle, honeybee, mouse, and sea anemone, we have studied the molecular evolution of 91 Drosophila genes involved in eye primordium determination, retinal differentiation, and phototransduction. Our results show that the majority of these gene sequences predate the diversification of endopterygote insects. However, all three functional groups contain a conspicuous fraction of evolutionarily younger genes, which originated by tandem duplication in the lineage leading to Drosophila, whereas gene duplications are rare in other insect lineages. We conclude that the retention of duplicated genes spiked during the early diversification of the higher Diptera possibly due to an extended period of exceptional population size reduction. Genetic data suggest that gene duplication played an important role in the evolution of visual performance in the fast flying higher Diptera by spatial or intracellular subfunctionalization. Developmental gene duplications, by contrast, predominantly retained overlapping expression patterns and preserved partial to complete redundancy consistent with a role in boosting developmental robustness.