The reaction of 1‐cyanomethylpyridinium chloride or bromide, 1a‐i, with 1,1‐bis(methylthio)‐2‐nitroethylene (2) in the presence of triethylamine as a base in ethanol gave the corresponding 2‐methylthioindolizine‐3‐carbonitrile 3 and 2‐methyl‐thio‐1‐nitroindolizine‐3‐carbonitrile 4 in good yields, respectively. Compounds 3a,f were key intermediates for the synthesis of cycl[3.2.2]azine derivatives.