The three-component synthesis of 7-substituted 6-ethoxycarbonyl-5-methyl-4,7-dihydroazolo[1,5-a]pyrimidines was carried out for the first time by the reactions of aminoazoles (3-aminopyrazole, 3-amino-1,2,4-triazole, or 5-aminotetrazole) with acetoacetic ester and aliphatic, aromatic, or heteroaromatic aldehyde.