Summary paragraphThe mating system of a species profoundly influences its evolutionary trajectory1–3. Across diverse taxa, selfing species have evolved independently from outcrossing species thousands of times4. The transition from outcrossing to selfing significantly decreases the effective population size, effective recombination rate, and heterozygosity within a species5. These changes lead to a reduction in the genetic diversity, and therefore adaptive potential, by intensifying the effects of random genetic drift and linked selection6,7. Selfing has evolved at least three times independently in the nematode genus Caenorhabditis8, including in the model organism Caenorhabditis elegans, and all three selfing species show substantially reduced genetic diversity relative to outcrossing species8,9. Selfing and outcrossing Caenorhabditis species are often found in the same niches, but we still do not know how selfing species with limited genetic diversity can adapt to and inhabit these same diverse environments. Here, we discovered previously uncharacterized levels and patterns of genetic diversity by examining the whole-genome sequences from 609 wild C. elegans strains isolated worldwide. We found that genetic variation is concentrated in punctuated hyper-divergent regions that cover 20% of the C. elegans reference genome. These regions are enriched in environmental response genes that mediate sensory perception, pathogen response, and xenobiotic stress. Population genomic evidence suggests that these regions have been maintained by balancing selection. Using long-read genome assemblies for 15 wild isolates, we found that hyper-divergent haplotypes contain unique sets of genes and show levels of divergence comparable to that found between Caenorhabditis species that diverged millions of years ago. Taken together, these results suggest that ancient genetic diversity present in the outcrossing ancestor of C. elegans has been maintained by long-term balancing selection since the evolution of selfing. These results provide an example for how species can avoid the evolutionary “dead end” associated with selfing by maintaining ancestral genetic diversity.