Reactions of sodium salts of substituted 3-amino-2-cyano-3-thioacrylic esters and amides with α-halomethylketones were studied. Conditions were found which led to the synthesis of either 5-acyl-2,4-diaminothiophene-3-carboxylic esters and amides or thiazoline-Δ2α-acetic esters and amides. Some thiophene-3-carboxamides were also transformed into thienopyrimidines upon acetylation.