The synthesis of pipecolic acid and homopipecolic acidderivatives was developed from ω-(2-aminophenyl)-1-chloroalkyl p-tolyl sulfoxides by treatment with i-PrMgCl. An intramolecular nucleophilic substitution reaction of a magnesium carbenoid with an N-magnesio arylamine is the key step of this reaction. Proline and pipecolic acidderivatives were also synthesized from ω-(arylamino)-1-chloroalkyl p-tolyl