Ranitidine is prepared by treating an aldehyde of formula (II) ##STR1## with dimethylamine and a reducing agent which is capable of effecting reductive alkylation to introduce the group Me.sub.2 NCH.sub.2 -- but which does not reduce the nitroethene group. The reaction is carried out in a suitable solvent, preferably in the presence of an acid or followed by treatment with an acid. Suitable reducing agents include, diborane, aluminium hydride and alkali or alkaline earth metal borohydrides. The aldehyde (II) may be generated in situ from an acetal of formula (III) ##STR2## where R.sub.1 and R.sub.2 are both alkyl groups or R.sub.1 OCHOR.sub.2 forms a cyclic acetal.