Preparation of an appropriate 4,5-diaminopyrimidine by introduction of the amino group into the 5 position of 4-amino-6-hydroxy- or 4,6-diaminopyrimidines by nitrosation and ammonium sulfide reduction, followed by ring closure with formic acid or chlorocarbonic ester.