The invention relates to a new process for the preparation of N-sulfamyl-3-(2-guanidinothiazol-4-yl-methylthio)-propionitrile (famotidine) of the formula (I) ##STR1## by S-alkylation of 2-guanidino-thiazol-4-yl-methanethiol obtained from S-(2-guanidino-thiazol-4-yl-methyl)-isothiourea dihydrochloride of the formula (III) ##STR2## by in situ treatment with a base, which comprises carrying out S-alkylation with a N-sulfamyl-3-halopropionamidine of the formula (II) ##STR3## wherein X stands for halogen.