The authors describe an efficient method for microextraction and preconcentration of trace quantities of cationic nitrogen compounds, specifically of anilines. It relies on a combination of electrochemically controlled solid-phase microextraction and on-line in-tube solid-phase microextraction (SPME) using polypyrrole-coated capillaries. Nanostructured polypyrrole was electrically deposited on the inner surface of a stainless steel tube and used as the extraction phase. It also acts as a polypyrrole electrode that was used as a cation exchanger, and a platinum electrode that was used as the anode. The solution to be extracted is passed over the inner surface of the polypyrrole electrode, upon which cations are extracted by applying a negative potential under flow conditions. This method represents an ideal technique for SPME of protonated anilines because it is fast, easily automated, solvent-free, and inexpensive. Under optimal conditions, the limits of detection are in the 0.10-0.30 μg L‾ 1 range. The method works in the 0.10 to 300 μg L‾ 1 concentration range. The inter-and intra-assay precisions (RSD%; for n=3) range from 5.1 to 7.5 % and from 4.7 to 6.0 % at the concentration levels of 2, 10 and 20 μg L‾ 1 , respectively. The EC-in-tube SPME method was successfully applied to the analysis of methyl-, 4-chloro-, 3-chloro and 3,4-dichloroanilines in (spiked) water samples.