Methylation of aniline by methanol on zeolite H-Y has been investigated by in situ (13)C MAS NMR spectroscopy under flow conditions. The in situ (13)C continuous-flow (CF) MAS NMR experiments were performed at reaction temperatures between 473 and 523 K, molar methanol-to-aniline ratios of 1:1 to 4:1, and modified residence times of (13)CH(3)OH between 20 and 100 (g x h)/mol. The methylation reaction was shown to start at 473 K. N,N,N-Trimethylanilinium cations causing a (13)C NMR signal at 58 ppm constitute the major product on the catalyst surface. Small amounts of protonated N-methylaniline ([PhNH(2)CH(3)](+)) and N,N-dimethylaniline ([PhNH(CH(3))(2)](+)) were also observed at ca. 39 and 48 ppm, respectively. After increase of the temperature to 523 K, the contents of N,N-dimethylanilinium cations and ring-alkylated reaction products strongly increased, accompanied by a decrease of the amount of N,N,N-trimethylanilinium cations. With application of the in situ stopped-flow (SF) MAS NMR technique, the decomposition of N,N,N-trimethylanilinium cations on zeolite H-Y to N,N-dimethylanilinium and N-methylanilinium cations was investigated to gain a deeper insight into the reaction mechanism. The results obtained allow the proposal of a mechanism consisting of three steps: (i) the conversion of methanol to surface methoxy groups and dimethyl ether (DME); (ii) the alkylation of aniline with methanol, methoxy groups, or DME leading to an equilibrium mixture of N,N,N-trimethylanilinium, N,N-dimethylanilinium, and N-methylanilinium cations attached to the zeolite surface; (iii) the deprotonation of N,N-dimethylanilinium and N-methylanilinium cations causing the formation of N,N-dimethylaniline (NNDMA) and N-methylaniline (NMA) in the gas phase, respectively. The chemical equilibrium between the anilinium cations carrying different numbers of methyl groups is suggested to play a key role for the products distribution in the gas phase.