A new ring-switching reaction of enaminoesters behaving as bisnucleophiles towards other enaminoesters behaving as biselectrophiles is described. By starting from pyroglutamic derivatives, this reaction provided easy access to methyl 5-oxo-1,2,3,5-tetrahydro-3-indolizinecarboxylates substituted by an aminoester side chain in position 6.