A method for the trace analysis of methylmercury (MeHg) and Hg(II) in water sample was developed, which involved stir bar sorptive extraction (SBSE) with in situ alkylation with sodium tetraethylborate and thermal desorption (TD)-gas chromatography-mass spectrometry (GC-MS). The limits of quantification of MeHg and Hg(II) are 20 and 10 ng L(-1) (Hg), respectively. The method shows good linearity and the correlation coefficients are higher than 0.999. The average recoveries of MeHg and Hg(II) in tap or river water sample are 102.1-104.3% (R.S.D.: 7.0-8.9%) and 105.3-106.2% (R.S.D.: 7.4-8.5%), respectively. This simple, accurate, sensitive, and selective analytical method may be used in the determination of trace amounts of MeHg and Hg(II) in tap and river water samples.