The leading hypothesis for the evolution of male genital complexity proposes that genital traits evolve in response to post-insemination sexual selection; that is, via cryptic female choice or sperm competition. Here, we describe a laser ablation technique for high-precision manipulation of microscale body parts of insects, and employ it to discern the adaptive function of a rapidly evolving and taxonomically important genital trait: the intromittent claw-like genital spines of male Drosophila bipectinata Duda. We demonstrate experimentally and unambiguously that the genital spines of this species function to mechanically couple the genitalia together. The excision of the spines by laser ablation sharply reduced the ability of males both to copulate and to compete against rival males for mates. When spineless males did succeed to copulate, their insemination success and fertilization rate were not statistically different from controls, at odds with the post-insemination sexual selection hypothesis of genital function and evolution. The results provide direct experimental support for the hypothesis that genital traits evolve in response to sexual selection occurring prior to insemination.