The detection of the pyrolysis product anhydroecgonine methyl ester (AEME, methylecgonidine) after cocaine smoking using gas chromatography-mass spectrometry is hampered by the artifactual production of AEME. The amount of AEME increases with the amount of cocaine used producing false positive values in authentic samples. A method for the correction of quantitative values was established using calibration of pyrolysis and estimation of the artifactual AEME. Authentic AEME in serum was differentiated from the artifact above 3.5 microg/l, 99% prediction limits of the quantitation were +/-3.1 microg/l. In 16 serum samples and five postmortem blood samples, cocaine and AEME were detected, but after application of the correction method only ten were truly positive for AEME.