ABSTRACT: In response to the growing concerns regarding pharmaceutical contamination of our aquatic systems, targeted actions are being implemented to align with the recommendations of the European Commission. However, a challenge lies in finding effective, accurate, and green chemistry-compliant methods for analyzing these compounds in complex matrices. This study introduces a highly sensitive and sustainable ultra-high-performance liquid chromatography-tandem mass spectrometry (UHPLC-MS/MS) method for simultaneously determining carbamazepine, caffeine, and ibuprofen in water and wastewater. This method exhibits impressive advantages: exceptional sensitivity, high selectivity, and an economical sample preparation strategy resulting from the absence of an evaporation step after solid-phase extraction (SPE), as well as a short analysis time (10 min). Following the International Council for Harmonization (ICH) guidelines Q2(R2), the developed and validated method proved to be specific, linear (correlation coefficients ≥ 0.999), precise (RSD < 5.0%), and accurate (recovery rates ranging from 77 to 160%). The limits of detection were 300 ng/L for caffeine, 200 ng/L for ibuprofen, and 100 ng/L for carbamazepine, respectively. The limits of quantification (LOQs) were 1000 ng/L for caffeine, 600 ng/L for ibuprofen, and 300 ng/L for carbamazepine. The advanced UHPLC-MS/MS method presented in this article constitutes a green and blue analytical technique for the precise detection and quantification of trace levels of pharmaceutical contaminants in aquatic environments. This method has been validated and exemplified using a case study from the Kraków area, highlighting its high efficiency, reliability, and minimal environmental impact. This approach aligns with the concept of sustainable analytics, combining ecological aspects with high-quality results. This study is therefore crucial for the effective monitoring of pollutants, the assessment of environmental and health risks, and ensuring water quality.