Involved in cell wall formation. Catalyzes the final step in the synthesis of UDP-N-acetylmuramoyl-pentapeptide, the precursor of murein. Catalyzes the addition of D-alanyl-D-alanine to UDP-MurNAc-L-alanyl-gamma-D-glutamyl-L-lysine. In vitro, can also use the mesodiaminopimelic acid-containing form of UDP-MurNAc-tripeptide, with the same efficiency, revealing that the discrimination for the amino acid residue at the third position of the peptide in the peptidoglycans is entirely supported by MurE