One of the detrimental effects of UV radiation on DNA is the formation of the (6-4) photoproduct (6-4PP) between two adjacent pyrimidines1. This lesion interferes with replication and transcription and may result in mutation and cell death2. In many organisms a flavoenzyme called photolyase uses blue light energy to repair the 6-4PP3. The molecular mechanism of the repair reaction is poorly understood. Here, we use ultrafast spectroscopy to show that the key step in the repair photocycle is a cyclic proton transfer between the enzyme and the substrate. By femtosecond synchronization of the enzymatic dynamics with the repair function, we followed the function evolution and observed direct electron transfer from the excited flavin cofactor to the 6-4PP in 225 ps but surprisingly fast back electron transfer in 50 ps without repair. Strikingly, we found that the catalytic proton transfer between a histidine residue in the active site and the 6-4PP, induced by the initial photoinduced electron transfer from the excited flavin cofactor to 6-4PP, occurs in 425 ps and leads to 6-4PP repair in tens of nanoseconds. These key dynamics define the repair photocycle and explain the underlying molecular mechanism of the enzyme’s modest efficiency