The selective advantage of sexual reproduction is widely regarded as a major unsolved problem in biology. Recently, it has been proposed that the fundamental selective advantage of sex is its promotion of recombinational repair and hence survival of DNA in the germ line of organisms. A bacteriophage T4 system was set up to test this theory. After a phage T4 injects its DNA into an Escherichia coli cell it quickly establishes a barrier, through its immunity function, to infection by a second phage T4, arriving at a later time. This barrier causes phage T4 to reproduce asexually. The immunity barrier has a selective advantage in preserving the host cell as a sole resource for the first phage. If the first phage's DNA is damaged by UV irradiation, however, it has a reduced probability of being able to survive in the host cell when it is there alone. It was found that UV irradiation, in addition to reducing the first phage's viability, also prevents the first phage from raising an effective immunity barrier. This UV-induced reduction in immunity now allows sexual interaction with later-arriving secondary phage or sexual reproduction. It was found that these secondary phage enhanced survival of genes of the UV-damaged first phage. This supports the theory that under DNA-damaging conditions, which should be prevalent in nature, sex would have a selective advantage.