Ethyl 2-(1-phenylpiperidin-2-yl) acetate was formed in a spontaneous cyclization from (E)-ethyl 7-oxohept-2-enoate whereas ethyl [1-(2-bromophenyl)-2-pyrrolidinyl] acetate could be synthesized in good overall yield when employing a stoichiometric amount of base to facilitate the intramolecular aza-Michael reaction.