A series of 2-methylthio-1,4-dihydropyrimidine derivatives (II) were synthesized in good yields by alkylation of 1,2,3,4-tetrahydropyrimidines (I) with methyl iodide in the presence of pyridine. Their structures were confirmed by elemental analysis, IR and 1H NMR spectra. The compounds were tested for analgesic activity by acetic acid induced writhing method. Compounds IIh, IIe, IIk and IIl showed excellent to good analgesic activity. Other compounds showed moderate analgesic activity. The observed analgesic activity is mainly because of inhibition of the peripheral pain mechanism by the title compounds.