The transformations of N-phenacyl(p-nitrophenacyl, benzyl)-2,5-dimethyl-4-nitrophenyl (nitrobenzyl, benzyl)pyridinium bromides under the influence of potassium carbonate solution were studied. Stable pyridinium ylids were obtained in the case of γ-phenylpyridines that contain a nitro group in the benzene ring and in the case of γ-benzylpyridines with an N-nitrosubstituted phenacyl group. The conclusion that electron-acceptor substituents have a stabilizing effect on the stability of the ylids was confirmed. Under these conditions γ-nitrobenzyl derivatives are converted to substituted 1,4-dihydropyridines. The positions at which deprotonation of the starting quaternary pyridinium salts occurs and the formation of 1,4- and 1,2-dihydropyridines were established by PMR spectroscopy. The corresponding pyridinium salts were converted to a new group of indolizines containing a p-nitrophenyl (p-nitrobenzyl) substituent in the 2 or 7 position by the Chichibabin method. It was established that substituted dihydropyridines are converted to indolizines; ideas that confirm the scheme of the previously proposed mechanism for the formation of indolizines through a step involving ylids are expressed. © 1979 Plenum Publishing Corporation.