A highly selective and sensitive method was developed for preconcentration of inorganic and organic mercury compounds followed by reversed-phase column high-performance liquid chromatography (RP-HPLC) with UV-visible detection. The method was based on the reaction of mercury with 6-mercaptopurine and solid-phase extraction (SPE) of the complex on an octadecylsilane (C18) cartridge. The complex was then treated with ammoniacal dithizone solution, and the complexes of inorganic and organic mercury with dithizone were eluted by methanol. The speciation analysis of methylmercury (MeHg), phenylmercury (PhHg), and inorganic Hg (II) was carried out by RP-HPLC. Some experimental variables that influence the SPE and derivatization, such as pH, chelating and derivatizing agent concentration, and surfactant addition, were investigated. The calibration graphs of MeHg, PhHg, and Hg (II) were linear [correlation coefficient (r) > 0.999] from the detection limits (0.12, 0.16, and 0.14 ng) to 8.5, 6.0, and 6.7 ng Hg, respectively. By applying the SPE procedure, a 100-fold concentration of the sample was obtained. The procedure was applied to sea water and tuna fish samples. The method's accuracy was investigated by using tuna fish certified reference material BCR 464 and by spiking the samples with different amounts of MeHg, PhHg, and Hg (II). The average recoveries of MeHg, PhHg, and Hg (II) from spiked samples (0.1-2.0 microg/L Hg) were 96 +/- 4, 98 +/- 3, and 104 +/- 4%, respectively.