A convenient and efficient synthetic method for the construction of morpholine and piperazine derivatives in moderate to good yields was established. The reaction proceeds smoothly with 1.0 mol% gold catalyst loading. A plausible mechanism involving the cascade cyclization and isomerizations to produce the six-membered ring was proposed and supported by deuterium labeling experiments.