Catalysis in biology is restricted to RNA (ribozymes) and protein enzymes, but synthetic biomolecular catalysts can also be made of DNA (deoxyribozymes)1 or synthetic genetic polymers2. In vitro selection from synthetic random DNA libraries identified DNA catalysts for various chemical reactions beyond RNA backbone cleavage3. DNA-catalysed reactions include RNA and DNA ligation in various topologies4,5, hydrolytic cleavage6,7 and photorepair of DNA8, as well as reactions of peptides9,10 and small molecules11,12. In spite of comprehensive biochemical studies of DNA catalysts for two decades, fundamental mechanistic understanding of their function is lacking in the absence of three-dimensional models at atomic resolution. Early attempts to solve the crystal structure of an RNA-cleaving deoxyribozyme resulted in a catalytically irrelevant nucleic acid fold13. Here we report the crystal structure of the RNA-ligating deoxyribozyme 9DB1 (ref. 14) at 2.8 Å resolution. The structure captures the ligation reaction in the post-catalytic state, revealing a compact folding unit stabilized by numerous tertiary interactions, and an unanticipated organization of the catalytic centre. Structure-guided mutagenesis provided insights into the basis for regioselectivity of the ligation reaction and allowed remarkable manipulation of substrate recognition and reaction rate. Moreover, the structure highlights how the specific properties of deoxyribose are reflected in the backbone conformation of the DNA catalyst, in support of its intricate three-dimensional organization. The structural principles underlying the catalytic ability of DNA elucidate differences and similarities in DNA versus RNA catalysts, which is relevant for comprehending the privileged position of folded RNA in the prebiotic world and in current organisms.