A method for the extraction and selective determination of cations is proposed using electro-synthesized overoxidized sulfortated polypyrrole film. The polymer film is used for the selective extraction of trace levels of nickel and cadmium ions by solid-phase microextraction (SPME). The cation uptake and release properties of the overoxidized sulfonated polypyrrole film electrode were examined under both open circuit and controlled potential conditions for prospective applications in electrochemically controlled solid-phase microextraction. Increased extraction efficiency and selectivity toward cations were achieved in high saline content of water. Simple preparation of film coatings on a platinum wire was possible using a constant potential method. Applied positive and negative potentials facilitated the extraction and desorption of cations, respectively. Nickel and cadmium ions were desorbed into sample aliquot and determined by electrothermal atomic absorption spectrometry (ETAAS). The cation uptake and release mechanism is affected both by the cation exchange at the negative sulfonate and carboxylate moiety on the film and the altered solution pH occurring at the counter electrode caused by the applied potential. The method was validated using a standard reference material and tested for the determination of cadmium ion in commercial table salt samples. (C) 2005 Elsevier B.V. All rights reserved.