Amines in heteroaromatic systems and pharmaceutical intermediates were functionalized through N-methylation with methanol using a palladium-loaded titanium dioxide (Pd/TiO2) photocatalyst. This method provides access to a series of tertiary N-methylamines bearing N-, O-, and/or S-containing heteroaromatic functionalities from primary/secondary amines and methanol under mild reaction conditions. Facile syntheses of several pharmaceuticals containing N-methyl or ethyl groups, as well as related deuterated drugs, was achieved through the late-stage functionalization of amines.