The stereoselectivity and stereospecificity of the triflate-mediated intramolecular Schmidt reaction of substituted 3-(1-azidocyclohexyl)propanol derivatives leading to octahydro-1H-pyrrolo[1,2-a]azepine, the structural skeleton of several important families of alkaloids such as the Stemona alkaloids, has been examined. The reaction involves an initial intramolecular SN2 reaction between the azide moiety and the triflate affording an intermediate spirocyclic aminodiazonoium salt that undergoes the expected 1,2-shift/N2-elimination followed by hydride-mediated iminium salt reduction. Remarkably, chiral alcohols are converted to the azabicyclic derivative with no or limited racemization. The initial asymmetric alcohol center controls the diastereoselectivity of the whole process, leading to the formation of one out of the four possible diastereoisomers of disubstituted octahydro-1H-pyrrolo[1,2-a]azepine. The origin of the stereoselectivity is rationalized based on theoretical calculations. The concise synthesis of (−)-(cis)-3-propylindolizidine and (−)-(cis)-3-butyllehmizidine, two alkaloids found in the venom of workers of the ant Myrmicaria melanogaster, is reported.