Treatment of anhydroecgonine methyl ester (I) with phenylmagnesium bromide (II) in Et2O affords a mixture of isomers from which phenyltropane derivative (III) is chromatographically separated. Nitration of (III) using nitronium tetrafluoroborate (NO2BF4) in acetonitrile provides derivative (IV), whose nitro group is then reduced by hydrogenation over Raney-Ni in MeOH to yield the p-amino derivative (V). Finally, the desired product is obtained by treatment of (V) with diiodomethane and isoamyl nitrite (VI).