A new route to 5-(p-hydroxybenzyl)pyrimidines has been developed which utilizes phenolic Mannich bases plus pyrimidines containing at least two activating groups. The products can be alkylated on the phenolic oxygen or on the pyrimidine N-1 atom, depending on conditions. This method has been used to prepare trimethoprim, a broad-spectrum antibacterial agent, starting from 2,4-diaminopyrimidine and 2,6-dimethoxyphenol.