The present invention is concerned with an improved method of producing (R)-2-acetamido-N-benzyl-3-methoxypropionamide (lacosamide) comprising the O-methylation of a compound of formula I