A method was developed for simultaneously analyzing cocaine (COC), benzoylecgonine (BZE), norbenzoylecgonine (BNE), norcocaine (NCOC), ecgonine (ECG), ecgonine methyl ester (EME), m-hydroxybenzoylecgonine (HBZE), anhydroecgonine methyl ester (AEME), cocaethylene (CE), norcocaethylene (NCE), and ecgonine ethyl ester (EEE) in blood, urine, and muscle. Available deuterated analogs of these analytes were used as internal standards. Proteins from blood and muscle homogenate were precipitated with cold acetonitrile. After the removal of acetonitrile by evaporation, the supernatants and urine were subjected to solid-phase extraction. The eluted analytes were converted to their hydrochloride salts and derivatized with pentafluoropropionic anhydride and 2,2,3,3,3-pentafluoro-1-propanol. The derivatized products were analyzed by a gas chromatograph (GC)/mass spectrometer by selected ion monitoring. The limit of detection (LOD) for COC, BZE, NCOC, EME, CE, NCE, and EEE was 2 ng/ml, while the LODs for BNE, ECG, HBZE, and AEME were 25, 640, 50, and 13 ng/ml, respectively. This method was successfully applied in analyzing 13 case samples from aviation accident pilot fatalities and motor vehicle operators. AEME concentrations found in the 13 samples were consistent with those produced solely by the GC inlet pyrolysis of COC controls in blood. Anhydroecgonine cannot be used as a marker for the abuse of COC by smoking because it is also pyrolytically produced from COC metabolites on the GC inlet. The developed method can be effectively adopted for analyzing COC and related compounds in urine, blood, and muscle by a single extraction with increased sensitivity through formation of hydrochloride salts and using a one-step derivatization.