Zolpidem and zopiclone (Z-compounds) are non-benzodiazepine hypnotics of new generation that can be used in drug-facilitated sexual assault (DFSA). Their determination in biological fluids, mainly urine, is of primary importance; nevertheless, although they are excreted almost entirely as metabolites, available methods deal mainly with the determination of the unmetabolized drug. This paper describes a method for the determination in urine of Z-compounds and their metabolites by ultra-high-pressure liquid chromatography/tandem mass spectrometry (UHPLC-MS/MS) and UHPLC coupled with high resolution/high accuracy Orbitrap® mass spectrometry (UHPLC-HRMS). The metabolic profile was studied on real samples collected from subjects in therapy with zolpidem or zopiclone; the main urinary metabolites were identified and their MS behaviour studied by MS/MS and HRMS. Two carboxy- and three hydroxy- metabolites, that could be also detected by gas chromatography/mass spectrometry (GC-MS) as trimethylsylyl derivatives, have been identified for zolpidem. Also, at least one dihydroxilated metabolite was detected. As for zopiclone, the two main metabolites detected were N-demethyl and N-oxide zopiclone. For both substances, the unmetabolized compounds were excreted in low amounts in urine. In consideration of these data, a UHPLC-MS/MS method for the determination of Z-compounds and their main metabolites after isotopic dilution with deuterated analogues of zolpidem and zopiclone and direct injection of urine samples was set up. The proposed UHPLC-MS/MS method appears to be practically applicable for the analysis of urine samples in analytical and forensic toxicology cases, as well as in cases of suspected DFSA.