The pharmacologically important tropane alkaloids have a scattered distribution among angiosperm families, like many other groups of secondary metabolites. To determine whether tropane alkaloids have evolved repeatedly in different lineages or arise from an ancestral pathway that has been lost in most lines, we investigated the tropinone-reduction step of their biosynthesis. In species of the Solanaceae, which produce compounds such as atropine and scopolamine, this reaction is known to be catalyzed by enzymes of the short-chain dehydrogenase/reductase family. However, in Erythroxylum coca (Erythroxylaceae), which accumulates cocaine and other tropane alkaloids, no proteins of the short-chain dehydrogenase/reductase family were found that could catalyze this reaction. Instead, purification of E. coca tropinone-reduction activity and cloning of the corresponding gene revealed that a protein of the aldo-keto reductase family carries out this reaction in E. coca. This protein, designated methylecgonone reductase, converts methylecgonone to methylecgonine, the penultimate step in cocaine biosynthesis. The protein has highest sequence similarity to other aldo-keto reductases, such as chalcone reductase, an enzyme of flavonoid biosynthesis, and codeinone reductase, an enzyme of morphine alkaloid biosynthesis. Methylecgonone reductase reduces methylecgonone (2-carbomethoxy-3-tropinone) stereospecifically to 2-carbomethoxy-3β-tropine (methylecgonine), and has its highest activity, protein level, and gene transcript level in young, expanding leaves of E. coca. This enzyme is not found at all in root tissues, which are the site of tropane alkaloid biosynthesis in the Solanaceae. This evidence supports the theory that the ability to produce tropane alkaloids has arisen more than once during the evolution of the angiosperms.