This work describes a novel and sensitive method for the determination of codeine, heroin, and dextromethorphan, using flow injection with electrogenerated chemiluminescence (ECL). The method is based on the ECL reaction of tris(2,2'-bipyridine) ruthenium(II) [Ru(bpy)(2)(2+)] with tertiary amino groups. The factors affecting the determinations were investigated and possible reaction inhibitors, such as phenolic functional groups, were identified. Linear calibrations were obtained for signal (mV) versus concentration (mu mol l(-1)) in the range 0.1-1.0 mu mol l(-1) with percentage relative standard deviations of less than 5% (n = 5). The 50 limits of detection were calculated as 15, 45 and 44 nmol l(-1) for codeine, heroin, and dextromethorphan, respectively.