Background: The N-methyl-D-aspartate antagonist ketamine has rapid onset antidepressant activity in treatment-resistant depression (TRD). Aims: To evaluate mood rating, safety and tolerability data from patients with TRD treated with ketamine and the psychoactive control fentanyl, as part of a larger study to explore EEG biomarkers associated with mood response. Methods: We evaluated the efficacy and safety of intramuscular racemic ketamine in 25 patients with TRD, using a double-blind active-controlled randomized crossover design. Ketamine doses were 0.5 and 1 mg/kg, and the psychoactive control was fentanyl 50 mcg, given at weekly intervals. Results/outcomes: Within 1 h of ketamine dosing, patients reported reduced depression and anxiety ratings, which persisted for up to 7 days. A dose–response profile for ketamine was noted for dissociative side effects, adverse events and changes in blood pressure; however, changes in mood ratings were broadly similar for both ketamine doses. Overall, 14/25 patients (56%) were responders (⩾50% reduction at 24 h compared with baseline) for either ketamine dose for the Hospital Anxiety and Depression Scale (HADS), and 18/25 (72%) were responders for the HADS-anxiety scale. After fentanyl, only 1/25 (HADS-depression) and 3/25 (HADS-anxiety) were responders. Ketamine was generally safe and well tolerated in this population. Conclusions: Our findings add to the literature confirming ketamine’s activity against depressive and anxiety symptoms in patients with TRD.