A general method based on capillary electrophoresis with electrochemical detection (CE–ED) was developed for identification and determination of five flavonoids (kaempferol, apigenin, myricetin, quercetin and luteolin) in plant species. Running buffer, pH and concentration, separation voltage, injection time and detection potential were investigated to acquire the optimum conditions. The working electrode was a 500 μm diameter carbon disc electrode positioned opposite the outlet of capillary. At room temperature, the five flavonoids could be well separated within 21 min in a 60 cm length capillary at a separation voltage of 19.5 kV with 50 mM Na2B4O7–100 mM NaH2PO4 (pH 8.50) as the running buffer. The relationship between peak currents and analyte concentrations was linear over about two orders of magnitude, and the detection limits (S/N = 3) were ranging from 0.12 to 0.21 μg/ml for all analytes. The optimized CE–ED method was employed to analyze the above flavonoids in different parts of Portulaca oleracea L.