A solid‐phase extraction combined with a liquid chromatography‐tandem mass spectrometry analysis has been developed and validated for the simultaneous determination of 44 pharmaceuticals belonging to different therapeutic classes (i.e., antibiotics, anti‐inflammatories, cardiovascular agents, hormones, neuroleptics, and anxiolytics) in water samples. The sample preparation was optimized by studying target compounds retrieval after the following processes: i) water filtration, ii) solid phase extraction using Waters Oasis HLB cartridges at various pH, and iii) several evaporation techniques. The method was then validated by the analysis of spiked estuarine waters and wastewaters before and after treatment. Analytical performances were evaluated in terms of linearity, accuracy, precision, detection, and quantification limits. Recoveries of the pharmaceuticals were acceptable, instrumental detection limits varied between 0.001 and 25 pg injected and method quantification limits ranged from 0.01 to 30.3 ng/L. The precision of the method, calculated as relative standard deviation, ranged from 0.3 to 49.4%. This procedure has been successfully applied to the determination of the target analytes in estuarine waters and wastewaters. Eight of these 44 pharmaceuticals were detected in estuarine water, while 26 of them were detected in wastewater effluent. As expected, the highest values of occurrence and concentration were found in wastewater influent.