The extraction adsorbent was fabricated by immobilizing the highly specific recognition and binding of aptamer onto the surface of Fe O magnetic nanoparticles, which not only acted as recognition elements to recognize and capture the target molecule berberine from the extract of Cortex phellodendri, but also could favor the rapid separation and purification of the bound berberine by using an external magnet. The developed solid-phase extraction method in this work was useful for the selective extraction and determination of berberine in Cortex phellodendri extracts. Various conditions such as the amount of aptamer-functionalized Fe O magnetic nanoparticles, extraction time, temperature, pH value, Mg concentration, elution time and solvent were optimized for the solid-phase extraction of berberine. Under optimal conditions, the purity of berberine extracted from Cortex phellodendri was as high as 98.7% compared with that of 4.85% in the extract, indicating that aptamer-functionalized Fe O magnetic nanoparticles-based solid-phase extraction method was very effective for berberine enrichment and separation from a complex herb extract. The applicability and reliability of the developed solid-phase extraction method were demonstrated by separating berberine from nine different concentrations of one Cortex phellodendri extract. The relative recoveries of the spiked solutions of all the samples were between 95.4 and 111.3%, with relative standard deviations ranging between 0.57 and 1.85%.