A new, universal and diastereospecific method has been developed for the synthesis of 5,6-dihydropyridin-2(1H)-ones, 1,5,6,8,8a-hexahydroisoquinolin-3(2H)-ones and 4a,5,6,7,8,8a-hexahydroquinolin-2(1H)-ones (4) based on the intramolecular Wittig cyclization of the triphenyphosphonium salts 2 derived from the N-(3-oxoalkyl)–chloroacetamides 1.