Nucleic acid molecules from cannabis has been isolated and characterized and encode polypeptides having aromatic prenyltransferase activity. Expression or over-expression of the nucleic acids alters levels of cannabinoid compounds. The polypeptides may be used in vivo or in vitro to produce cannabinoid compounds.