Catalyzes the transfer of a methyl group onto N-acetylserotonin, producing melatonin (N-acetyl-5-methoxytryptamine). N-acetylserotonin + S-adenosyl-L-methionine = H(+) + melatonin + S-adenosyl-L-homocysteine Aromatic compound metabolism; melatonin biosynthesis; melatonin from serotonin: step 1/2. Homodimer. Expressed predominantly in the pineal gland (at protein level). Very low expression, if any, in the retina. Exhibits very subtle night/day variation, if any. Pineal melatonin synthesis is severely compromised in most inbred strains. In many inbred strains, genetic defects in ASMT have been identified. Melatonin production may have an impact on gonadal development, testis development being significantly promoted in melatonin-deficient C57BL/6J x Mus musculus molossinus animals (PubMed:20308563). Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family.