In this study, we demonstrate the application of newly developed magnetic potassium substituted hydroxyapatite (KHA/Fe3O4) for the extraction of phthalate esters (PE) from water samples. Nanoparticles of KHA were synthesized through an easy alkoxide–based sol–gel technique. The structure of nanocomposite was characterized by X–ray diffraction (XRD), Fourier transform infrared (FTIR) analysis, and energy dispersive X–ray Analysis (EDXA). Moreover, the size of nanoparticle and micro–strain of synthesized KHA and KHA/Fe3O4 using Williamson–Hall (W–H) plots and transmission electron microscopy (TEM) were measured. The hexagonal and cubic structures of synthesized KHA and its nanocomposite having P63/m space group confirmed by XRD pattern. Also, the size of spherical particles of KHA in pure and nanocomposite, and Fe3O4 nanoparticles evaluated by W–H and TEM methods are in good agreement as 60, 65, and 18 nm. The PEs were analyzed by gas chromatography‒flame ionization detector (GC‒FID). Different parameters influencing the extraction efficiency including: sample pH, amount of sorbent, extraction time, desorption conditions, and salt effect, were optimized. The obtained optimal conditions were: sample pH, 7; amount of sorbent, 25 mg; extraction time, 8.0 min; desorption solvent and its volume, 200 μL dichloromethane; and desorption time, 5.0 min. Under optimum conditions, good linearity was achieved for all analytes in the 0.015–100 ng mL−1 concentration range. The limits of detection (at an S/N ratio of 3) are between 0.005 and 0.03 ng mL−1. The recoveries of PEs from spiked real water samples are between 86.3 and 99.2%, with relative standard deviations between 5.3 and 9.3 %.