An extensive conformational search of the potent opioid analgesic, fentanyl, was performed using the semiempirical quantum mechanical method AM1 and the CHARMm potential energy function. A combination of two procedures was used to search the conformational space for fentanyl, which included nested dihedral scans, geometry optimization and molecular dynamics simulation at different temperatures. In addition, the effect of a continuum solvent environment was taken into account by use of appropriate values for the dielectric constant in the CHARMm computations. The results of the conformational search allowed the determination of the probable conformation of fentanyl in polar and nonpolar solvents and of three candidate conformers for its bioactive form.