Is required for the biosynthesis of pyrrolysine (PubMed:17204561, PubMed:21455182). Catalyzes the ATP-dependent ligation between (3R)-3-methyl-D-ornithine and L-lysine, leading to (3R)-3-methyl-D-ornithyl-N6-L-lysine (PubMed:21455182). (3R)-3-methyl-D-ornithine + ATP + L-lysine = (3R)-3-methyl-D-ornithyl-N(6)-L-lysine + ADP + H(+) + phosphate Binds 2 magnesium ions per subunit. Amino-acid biosynthesis; L-pyrrolysine biosynthesis. Cells lacking this gene are unable to translate UAG as pyrrolysine, and do not produce pyrrolysine. Belongs to the PylC family.