The development of a safe, robust, and efficient manufacturing route for the synthesis of diaminopyrimidine 1, a key intermediate to gefapixant citrate (MK-7264), is described. A full mechanistic understanding of the cyclization step in the presence of guanidine was established by performing isotopic labeling experiments and identification of impurities. Guided by the mechanistic understanding, further attempts to modify the cyclization reaction by employing additives to reduce the triazine (9) formation and guanidine loading will also be presented. This newly developed method delivered compound 1 in 88−94% yield on a commercial scale and addressed the shortcomings of the early synthetic route including high PMI, low atom economy, long cycle-time, and multiple purifications to achieve the desired quality.