Twenty-four pharmaceutical active compounds (PhACs) were evaluated in the soft tissues of clams Ruditappes decussatus exposed along a 1.5-km dispersal gradient of the treated effluent from an urban wastewater treatment plant discharging in Ria Formosa, and compared with those in the marine waters and discharged effluents. The clams were exposed for 1 month, in June–July 2016, 2017 and 2018. PhACs were quantified by high performance liquid chromatography coupled to tandem mass spectrometry after the quick, easy, cheap, effective, rugged and safe (QuEChERS) method (clams) or solid-phase extraction (water samples). The most representative PhACs in the effluents and receiving waters (regardless of the tidal dilution effect) were diclofenac, carbamazepine and caffeine (on average ≤ 2 μg/L) and only caffeine exhibited significant inter-annual differences, with higher values in 2017. In turn, the most bioaccumulated PhACs in clams were caffeine (0.54–27 ng/g wet weight, significantly higher in 2016) and acetaminophen (0.37–3.7 ng/g wet weight, significant lower in 2016). A multivariate principal component analysis showed (i) PhAC bioaccumulation primarily depended on biotic factors (clams length and weight), (ii) PhAC physicochemical properties Log Kow, pKa and water solubility interplaying with water abiotic variables were more relevant for explaining data variability in water than the physical dilution/tidal mixing, (iii) this process, reflected by the salinity gradient, had a tertiary role in data variation, responsible for spatial discrimination of marine waters. This study provides a better understanding of PhACs bioaccumulation by clams Ruditapes decussatus in real environmental conditions, under the influence of urban treated effluent dispersal in Ria Formosa coastal lagoon, a major producer of bivalves, ultimately disentangling key factors of PhAC bioaccumulation.