Synthesis of tri- or tetrasubstituted pyrimidine derivatives through the [5+1] annulation of enamidines with either N,N-dimethylformamide dialkyl acetals or orthoesters and their application in a ring transformation of pyrimidines to pyrido[2,3-d]pyrimidin-5-one derivatives.