Abstract: For the preparation of compounds such as ranitidine, niperotidine and cimetidine a urea of the formula:R.sub.1 --NH--C--NH--(CH.sub.2).sub.n --SD--S--(CH.sub.2).sub.n --NH--C--NH--R.sub.1 (I)which is synthesized by reaction with a compound of formula ##STR1##[H.sub.2 N--(CH.sub.2).sub.n --S--] (IX)is converted in a first stage into the corresponding bis-carbodiimideR.sub.1 --N.dbd.C.dbd.N--(CH.sub.2).sub.n --S--S--(CH.sub.2).sub.n --N.dbd.C.dbd.N--R.sub.1 (II)by reaction with triphenylphospine and bromine in the presence of a strong base and in a second stage the diimide thus obtained is reacted with nitromethane or a saline derivative of the cyanamide.The product thus obtained is reduced at the disulfide bridge obtaining a compound of formula: ##STR2## which is reacted with: ##STR3## to obtain ranitidine and niperotidine or cimetidine respectively depending on whether the first or the second of the described reactants is used.