A novel thermal rearrangement, involving pyrimidine ring opening and subsequent ring closure leading to recyclization of the system, was identified in the reaction of (6-oxo-1,6-dihydropyrimidin-2-yl)guanidines 3 (where NR1R2 = NH2, NH alkyl, NH aralkyl, NHCH2Ph(R)) with triethyl orthoacetate, affording 4-substituted-2-methyl-6H-pyrimido[1,2-a][1,3,5]triazin-6-ones 6 and their ring opened products. However, no such rearrangement was observed with (6-oxo-1,6-dihydropyrimidin-2-yl)guanidines 3 bearing a tertiary amino or anilino substituent (i.e. where NR1R2 = N(CH3)2, indoline, morpholino, NHAr). As expected, 2-substituted-4-methyl-6H-pyrimido[1,2-a][1,3,5]triazin-6-ones 4 were obtained as the final products. Experimental structural determination and theoretical studies were carried out to get an understanding of the observed thermal rearrangement. In addition, an attempt to obtain similar pyrimido[1,2-a][1,3,5]triazin-6-ones using N,N-dimethylacetamide dimethyl acetal (DMA–DMA) as one carbon inserting synthon had furnished triazine ring annulated product 14 bearing N,N-dimethyl enamino substituent at position 4 as a result of further reaction with a second molecule of DMA–DMA.