This work describes the development, optimization and validation of an analytical method for the simultaneous detection and identification of 74 pharmaceutically active compounds (PhACs), from various therapeutic groups, in both environmental (ground and surface water) and wastewaters (WW). The method is based on the simultaneous extraction of all target compounds by solid phase extraction (SPE), using a hydrophilic–lipophilic balanced polymer followed by ultra high performance liquid chromatography (UHPLC) tandem mass spectrometry (MS/MS). Two selected reaction monitoring (SRM) transitions have been monitored per compound in order to fulfil the EC guidelines, as well as to ensure an accurate identification of target compounds in the samples. Quantification is performed by internal standard approach, applying 24 specific isotopically labeled compounds. The main advantages of the developed method, besides the selectivity and reliability of the results, is its high throughput. All compounds are extracted in a single step and the instrumental analysis lasts 5min (NI mode)+8min (PI mode), allowing fast throughput of samples. The limits of detection range from 0.01 to 50ngL −1 , depending on the matrix, for most of the compounds. Finally, the method developed has been applied to the analysis of pharmaceuticals in the Ebro river basin (NE Spain).