Highlights d During evolution, the cavefish P. andruzzii has lost photoreactivation DNA repair d Only P. andruzzii and placental mammals are known to lack photoreactivation d The D-box enhancer coordinates DNA repair in response to ROS, UV, and visible light d Loss of D-box function in P. andruzzii underlies the lack of photoreactivation SUMMARY How the environment shapes the function and evolution of DNA repair systems is poorly understood. In a comparative study using zebrafish and the Somalian blind cavefish, Phreatichthys andruzzii, we reveal that during evolution for millions of years in continuous darkness, photoreactivation DNA repair function has been lost in P. andruzzii. We demonstrate that this loss results in part from loss-of-function mutations in pivotal DNA-repair genes. Specifically, C-terminal truncations in P. andruzzii DASH and 6-4 photolyase render these proteins predominantly cytoplasmic, with consequent loss in their functionality. In addition, we reveal a general absence of light-, UV-, and ROS-induced expression of P. andruzzii DNA-repair genes. This results from a loss of function of the D-box enhancer element, which coordinates and enhances DNA repair in response to sunlight. Our results point to P. andruzzii being the only species described, apart from placental mammals, that lacks the highly evolutionary conserved photoreactivation function. We predict that in the DNA repair systems of P. andruzzii, we may be witnessing the first stages in a process that previously occurred in the ancestors of placental mammals during the Mesozoic era.