A general method for the synthesis of 5-substituted indolizidines based on intramolecular cyclization of trans- and cis-2-allyl-6-R-1,2,3,6-tetrahydropyridines, obtained from pyridine and triallylborane, has been elaborated. The closure of the five-membered ring is carried out by hydroboration-oxidation followed by cyclization of the resulting delta-amino alcohols in the presence of the Ph3P-CBr4-Et3N system. (Pr2BH)(2) and Pr3B are used as the hydroborating reagents, and H2O2 in an acid medium is used for the oxidation of 2-[3-(dipropylboryl)propyl]-Delta(3)-piperideines formed. This method has been used for the synthesis of two natural alkaloids: indolizidine 209D (cis-5-hexylindolizidine) and its trans-isomer were prepared from cis- and trans-2-allyl-6-hexyl-1,2,3,6-tetrahydro respectively; indolizidine 167B and trans-5-propylindolizidine were synthesized from cis- and trans-2,6-diallyl-1,2,3,6-tetrahydropyridine, respectively.