Capillary electrophoresis with fluorescence detection has been investigated for simple, sensitive, and selective analysis of morphine and 6-acetylmorphine (6-AM) in human urine. The method is based on the reaction of morphine and 6-AM with the freshly prepared diazonium salt of aniline at 0°C. The method is selective in the presence of codeine. Conditions that affect derivatization (diazonium concentration and reaction time) and separation (electrolyte concentration, pH, β-cyclodextrin concentration, organic additives, and separation potential) were studied. When fluorescence detection was used with an excitation wavelength of 350 nm and an emission cutoff filter of 500 nm, good linearity was obtained in the range of 50–2000 ng mL–1 with limits of detection and quantification below 1.0 and 3.3 ng mL–1, respectively. The method was applied to human urine and validated by comparison with previously established capillary electrophoretic methods. Accuracy, repeatability, and intermediate precision of results were comparable. The method is suitable for application in forensic cases for initial screening, and in clinical analysis to prevent overdose-induced toxicity.