The reaction of 5-amino-3-(cyanomethyl)-1H-pyrazole-4-carbonitrile with 3-aryl-2,4-di (ethoxycarbonyl)-5-hydroxy-5-methylcyclohexanones in boiling acetic acid leads to the formation of new 4,5,6,7,8,9-hexahydropyrazolo[1,5-a]quinazolines. The mechanism is discussed. The structure of the products was confirmed by means of 1Н и 13С (DEPTQ) NMR, as well as 2D NMR (NOESY, 1Н–13С HSQC, HMBC).