This study is the first to use a new ZSM-5 zeolite-based composite decorated with iron oxide magnetic nanoparticles and modified with hexadecyltrimethylammonium bromide surfactant (i.e., HDTMA-ZSM-5/Fe2O3) as an efficient sorbent for magnetic dispersive solid-phase extraction (MDSPE) of nonsteroidal anti-inflammatory drugs in water and urine samples with subsequent measurement by liquid chromatography diode array detection. Experimental factors affecting MDSPE were optimized using a multivariate optimization strategy. The optimum experimental conditions were: amount of sorbent, 40 mg; sample pH, 2.2; NaCl concentration, 2.5%; extraction time, 2 min; eluent solvent, methanol; eluent solvent volume, 424 mu L; and elution time, 2 min. The linearity of the method was studied from 3.3 to 400 mu g L-1 (N=8) for ketoprofen, from 1.7 to 400 mu g L-1 (N =8) for felbinac, from 6.6 to 400 mu g L-1 (N=7) for diclofenac and from 9.9 to 400 mu g L-1 (N = 6) for ibuprofen. Method repeatability was evaluated at 10 and 200 mu g L-1 spiking levels, obtaining coefficients of variation between 2 and 5% (n = 6). Limits of detection, determined empirically, were 1.0 mu g L-1, 0.5 mu g L-1, 2.0 mu g L-1 and 3.0 mu g L-1 for ketoprofen, felbinac, diclofenac and ibuprofen, respectively. Tap water, reservoir water, wastewater and five urine samples were selected to assess method applicability. Recovery values ranged between 86-107% and 80-112% for water and urine samples, respectively, showing negligible matrix effects. Finally, this method was employed to monitor ibuprofen excretion in real urine samples. (C) 2019 Elsevier B.V. All rights reserved.