Recently, the new concept of three-phase liquid microextraction was introduced based on applying two immiscible organic solvents in lumen and wall pores of hollow fiber. In the present work, this novel microextraction technique combined with gas chromatography–mass spectrometry has been developed for determination of tramadol, an analgesic agent, in plasma and urine samples. A systematic investigation of the proposed method was applied to find optimal extraction conditions and evaluate the interaction effects between the factors by designing experiments according to the methodology of Box–Behnken response surface design. Analysis of variance (ANOVA) revealed that the important factors contributing to extraction efficiency are extraction time, stirring rate and hollow fiber length. Under the optimum conditions, the developed method provided a preconcentration factor of 546, good repeatability (RSD % = 6.4), and good linearity ( r 2 = 0.995) for spiked plasma and urine real samples. The linear dynamic range from 0.1 to 400 μg L −1 and limit of detection (LOD) of 0.08 μg L −1 were obtained under selected ion monitoring mode. The results demonstrated that three-phase hollow fiber microextraction based on two immiscible solvents is a simple and accurate technique with very good preconcentration factor and clean-up for extraction of tramadol from biological samples.