The reactions of N-methylmorpholinium 4-aryl(hetaryl)-5-cyano-2-oxo-1,2,3,4-tetrahydropyridine-6-thiolates with malononitrile and acetone in ethanol afforded substituted tetrahydropyridothienopyridinones. In the absence of acetone, tetrahydropyridothiopyranopyridinones were isolated as the major reaction products. The latter were also synthesized independently by the reactions of the above-mentioned thiolates with 2-amino-1,1,3-tricyanopropene. The structure of 2,4-diamino-10-(2-chlorophenyl)-3-cyano-5-imino-8-oxo-7,8,9,10-tetrahydro-5H-pyrido[2',3':2,3]thiopyrano[4,5-b]pyridine was established by X-ray diffraction analysis.