Efavirenz is one of the antiretroviral drugs widely used to treat the human immuno-deficiency virus. Antiretroviral drugs have been found to be present in surface water and wastewater. Due to complexity of environmental samples, solid-phase extraction (SPE) is used for isolation and pre-concentration of antiretroviral drugs prior to their chromatographic analysis. However, the commercially available SPE sorbents lack selectivity which tend to prolong the analysis time. Therefore, in this study a molecularly imprinted polymer was synthesized for the specific recognition of efavirenz and then applied as the SPE sorbent for its extraction from wastewater and surface water samples. The imprinted and non-imprinted polymers were synthesized using bulk polymerization technique where efavirenz was used as the template, 2-vinylpyridine as functional monomer, 1,1′-azobis-(cyclohexanecarbonitrile) as initiator, ethylene glycol dimethacrylate as cross-linker and toluene: acetonitrile (9: 1, v/v) as the porogenic solvent mixture. The characterization was performed using Fourier transform infrared spectroscopy, scanning electron microscopy, Brunauer-Emmett-Teller, elemental analysis, and thermogravimetric analysis techniques. Results showed better selectivity of molecularly imprinted polymer to efavirenz than non-imprinted polymer. The analysis was performed using high performance liquid chromatography equipped with photo diode array detector. The analytical method gave a detection limit of 0.41 g/L and the analyte recovery of 81% in wastewater. The concentrations found in wastewater ranged from 2.79 to 120.7 μg/L, while in surface water they were between 0.975 and 2.88 μg/L. Therefore, the results of this study show a strong need of a detailed screening of efavirenz in major water utilities in the country.