For the first time, a mixed-mode solid-phase extraction with fractionation of basic analytes from neutral and acidic species during cartridge elution and liquid chromatography-quadrupole-time-of-flight mass spectrometry (LC-QTOF-MS) was combined for the quantitative determination of 24 illicit drugs and metabolites in urban sewage samples. The effects of several sample preparation and instrumental parameters in the sensitivity and selectivity of the quantitative method are thoroughly discussed. Under final working conditions, recoveries above 63% and 82% were attained for all species in raw and treated sewage, respectively; whereas, the limits of quantification of the method, defined for a signal-to-noise of 10 (S/N = 10), ranged from 2 to 50 ng L(-1). Sequential elution of mixed-mode cartridges allowed a significant reduction of matrix effects observed during electrospray ionization of basic drugs versus those measured for hydrophilic balance reversed-phase sorbents and the same mixed-mode polymer without fractionated elution. Analysis of raw wastewater samples confirmed the ubiquity of cocaine (COC), benzoylecgonine (BE), and 11-nor-9-carboxy-Δ(9)-tetrahydrocannabinol (THCCOOH) in this matrix. The capability of the above methodology to identify new illicit drugs and/or metabolites in sewage samples is also discussed. With this aim, a two step strategy is proposed. First, high-resolution MS chromatograms, acquired throughout each chromatographic run, are automatically searched against an in-house built database, a reduced list of candidate drugs is generated, and the corresponding extracted ion chromatograms are obtained. In a further LC run, the tandem mass spectrometry (MS/MS) spectra of unknown peaks are acquired using different collision energies and compared with those existing in public libraries, or interpreted, to assign the unknown peak to one of the previously selected candidates.