The occurrence of pharmaceuticals in the aquatic environment has become a matter of concern in the last decade due to potential risks posed to non-target organisms and the potential for unintended human exposure via food chain. This concern has been driven by a high detection frequency for drugs in environmental samples; these substances are produced in large quantities and are used in both veterinary and human medicine, leading to deposition and potential effects in the environment. However, few studies have focused on the presence of pharmaceuticals in rural areas associated with farming activities in comparison to urban areas. The aim of this study is to investigate the occurrence of pharmaceutically active compounds in surface waters collected from urban and rural areas in northwestern Spain. A monitoring study was conducted with 312 river water samples analysed by high-performance liquid chromatography coupled to tandem mass spectrometry. Positive detection of pharmaceuticals was made for 51 % of the samples. Decoquinate, sulfamethazine, sulfamethoxypyridazine and trimethoprim were the drugs most frequently detected, being present in more than 10 % of the samples. The sampling sites located downstream of the discharge points for wastewater treatment plants yielded the highest number of positive samples, 13 % of the positive samples were detected in these sites and 38 % of the samples collected near the collection point of a drinking water treatment plant were positive.