Males and females have different fitness optima but share the vast majority of their genomes, causing an inherent genetic conflict between the two sexes that must be resolved to achieve maximal population fitness. We show that two tandem duplicate genes found specifically in Drosophila melanogaster are sexually antagonistic, but rapidly evolved sex-specific functions and expression patterns that mitigate their antagonistic effects. We use copy-specific knockouts and rescue experiments to show that Apollo (Apl) is essential for male fertility but detrimental to female fertility, in addition to its important role in development, while Artemis (Arts) is essential for female fertility but detrimental to male fertility. Further analyses show that Apl and Arts have essential roles in spermatogenesis and oogenesis. These duplicates formed ~200,000 years ago, underwent a strong selective sweep and lost most expression in the antagonized sex. These data provide direct evidence that gene duplication allowed rapid mitigation of sexual conflict by allowing Apl and Arts to evolve essential sex-specific reproductive functions and complementary expression in male and female gonads.