Co(II), Zn(II), Ni(II) and Fe(II) were successfully separated by capillary electrophoresis using pre-capillary and on-capillary complexation with 4-(2-thiazolylazo)resorcinol. The influences of some crucial parameters, including both pre- and on-capillary complexation procedure, were investigated. For on-capillary complexation, the complexing reaction was carried out inside the capillary by mixing the zones of ligand and sample during the electrophoretic migration. Compared with pre-capillary complexation, the method provided 30-fold reduction in detection limits for Co(II), 50-fold reduction for Zn(II), and 100-fold reduction for Ni(II) and Fe(II). It was used for the analysis of a pharmaceutical and tap water sample. (C) 2004 Elsevier B.V. All rights reserved.