A suitable molecularly imprinted polymer (MIP) as a solid phase extraction (SPE) sorbent has been synthesized for the selective separation and cleaning up of primidone from the biological and pharmaceutical samples. Electrospray ionization-ion mobility spectrometry (ESI-IMS) was also used as a detection system. The imprinted polymer was prepared by non-covalent method using primidone as the template, methacrylic acid (MAA) as the functional monomer, ethylene glycol dimethacrylate (EGDMA) as cross-linker agent, and 2,2'-azobis(2-isobutyronitrile) (AIBN) as initiator. In this work, the optimized conditions for the preparation of molecularly imprinted polymer and selective separation of this drug by MIP, were studied. In addition, these experiments were compared with the non-imprinted polymer (NIP) and the results indicated that NIP had no specific affinity to adsorb primidone. The retention capacity of the prepared MIP sorbent was 2.5 mg/g. Under optimum conditions, the proposed method with respect to other reported methods shows high sensitivity and selectivity, with detection limit of 0.005mg/mL, linear dynamic range of 0.02–2.00 mg/mL and good precision (R.S.D. 3%). The results obtained in this work reveal that the method could be successfully applied to assay trace amounts of primidone in pharmaceutical and human plasma samples.