Is required for the biosynthesis of pyrrolysine (PubMed:21525873). 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:21525873). Is also involved in the synthesis of pyrroline-carboxy-lysine (Pcl), a demethylated form of pyrrolysine that is generated by the pyrrolysine biosynthetic enzymes when the growth media is supplemented with D-ornithine (PubMed:21525873). (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. Belongs to the PylC family.