Slow-wave activity (SWA), a key indicator of sleep homeostasis, is often diminished in individuals with treatment-resistant depression (TRD). Ketamine, a rapid-acting antidepressant, increases SWA during the first period of non-rapid eye movement (NREM1) sleep. However, research into how ketamine affects sleep and its connection to treatment outcomes in TRD has been limited by small sample sizes and a lack of comparison with healthy volunteers (HVs). This placebo-controlled study compared the effects of ketamine on NREM1 SWA in a large sample of unmedicated TRD patients (n = 91; 51 F/40 M) and HVs (n = 42; 23 F/19 M). Linear mixed-effects models and regression analyses, with post-hoc testing (paired ttests and Wilcoxon matched-pairs signed rank tests), were used to assess condition-related effects across baseline, ketamine, and placebo in TRD and HV participants. Age-related moderation of ketamine-associated NREM1 SWA changes and condition-related changes in sleep variables were also examined. At baseline, TRD patients had lower NREM1 SWA than HVs. Ketamine, but not placebo, increased NREM1 SWA in TRD patients, particularly in responders. In contrast, ketamine had no effect on NREM1 SWA in HVs. Following ketamine, TRD patients also showed significant increases in total sleep time and sleep efficiency and a reduction in sleep latency. In TRD patients, the ketamine-related increase in NREM1 SWA diminished with increasing age. Together, the results indicate that ketamine's antidepressant effects appear closely associated with its ability to modulate early SWA. These effects may also be linked to ketamine's ability to improve sleep architecture in TRD. Clinical Trials Identifier: www.clinicaltrials.gov , NCT00088699, NCT01204918.