The potential of the polymerase chain reaction for the detection of ergot alkaloid producers among microscopic fungi of the genera Penicillium and Claviceps was evaluated. Twenty-three strains of various species of fungi with a previously studied capacity for alkaloid production were used. The internal fragment of the gene encoding 4-dimethylallyltryptophan synthase, the enzyme catalyzing the first step in the biosynthesis of ergot alkaloids, was amplified using degenerated primers. This approach revealed an about 1.2-kb specific DNA fragment in micromycetes synthesizing ergot alkaloids with complete tetracyclic ergoline system. Microorganisms that produce alkaloids with modified C or D ergoline rings, as well as alpha-cyclopiazonic acid, did not yield the PCR fragment of the expected size. This fragment was also not found in fungi incapable of ergot alkaloid production.