The origin, diversification, and secondary loss of sexually dimorphic characters are common in animal evolution. In some cases, structurally and functionally similar traits have evolved independently in multiple lineages. Prominent examples of such traits include the male-specific grasping structures that develop on the front legs of many dipteran insects. In this report, we describe the evolution and development of one of these structures, the male-specific "sex brush." The sex brush is composed of densely packed, irregularly arranged modified bristles and is found in several distantly related lineages in the family Drosophilidae. Phylogenetic analysis using 250 genes from over 200 species provides modest support for a single origin of the sex brush followed by many secondary losses; however, independent origins of the sex brush cannot be ruled out completely. We show that sex brushes develop in very similar ways in all brush-bearing lineages. The dense packing of brush hairs is explained by the specification of bristle precursor cells at a near-maximum density permitted by the lateral inhibition mechanism, as well as by the reduced size of the surrounding epithelial cells. In contrast to the female and the ancestral male condition, where bristles are arranged in stereotypical, precisely spaced rows, cell migration does not contribute appreciably to the formation of the sex brush. The complex phylogenetic history of the sex brush can make it a valuable model for investigating coevolution of sex-specific morphology and mating behavior.