Abstract Reactions of β-(2-furanyl)-and β-(2-thienyl)-acrylonitrile with ethyl acetoacetate are reported. They lead to new polyfunctional derivatives of pyrano [2, 3-b] pyridine and pyrano [2, 3-d]-pyrimidine. The structures of these products and the mechanisms of their formation are reported.