The enzyme catalyses the ligation of DNA strands with 3'-hydroxyl and 5'-phosphate termini, forming a phosphodiester and sealing certain types of single-strand breaks in duplex DNA. Catalysis occurs by a three-step mechanism, starting with the activation of the enzyme by ATP, forming a phosphoramide bond between adenylate and a lysine residue. The adenylate group is then transferred to the 5'-phosphate terminus of the substrate, forming the capped structure 5'-(5'-diphosphoadenosine)-[DNA]. Finally, the enzyme catalyses a nucleophilic attack of the 3'-OH terminus on the capped terminus, which results in formation of the phosphodiester bond and release of the adenylate. RNA can also act as substrate, to some extent. cf. EC 126.96.36.199, DNA ligase (NAD+), EC 188.8.131.52, DNA ligase (ATP or NAD+), and EC 184.108.40.206, DNA ligase (ATP, ADP or GTP).