Speciation-the splitting of one species into two-occurs by the evolution of any of several forms of reproductive isolation between taxa, including the intrinsic sterility and inviability of hybrids. Abundant evidence shows that these hybrid fitness problems are caused by incompatible interactions between loci: new alleles that become established in one species are sometimes functionally incompatible with alleles at interacting loci from another species. However, almost nothing is known about the genes involved in such hybrid incompatibilities or the evolutionary forces that drive their divergence. Here we identify a gene that causes epistatic inviability in hybrids between two fruitfly species, Drosophila melanogaster and D. simulans. Our population genetic analysis reveals that this gene-which encodes a nuclear pore protein-evolved by positive natural selection in both species' lineages. These results show that a lethal hybrid incompatibility has evolved as a by-product of adaptive protein evolution.