Three-component condensation of 3(5)-aminoazoles with benzaldehydes and dimedone in acetonitrile in the presence of montmorillonite KSF as heterogeneous catalyst regioselectively afforded 5,6,7,9-tetrahydroazolo[5,1-b]quinazolin-8(4H)-one derivatives in good yields. Oxidation of the condensation products with ceric ammonium nitrate in acetone gave the corresponding 6,7-dihydroazolo[5,1-b]quinazolin-8(5H)-ones.