Abnormalities during rapid eye movement (REM) sleep contribute to the pathophysiology of major depressive disorder (MDD), but few studies have explored the relationship between REM sleep and treatment-resistant depression (TRD). In MDD, REM sleep abnormalities often manifest as alterations in total night REM Density (RD), RD in the first REM period (RD1), and REM Latency (RL). Among these, RD1 is notably considered a potential endophenotype of depression. This study compared REM sleep markers between 63 drug-free individuals with TRD (39 F/24 M) and 41 healthy volunteers (25 F/16 M). It also investigated the effects of ketamine, an N-methyl-D-aspartate (NMDA) receptor antagonist, on these REM sleep variables. Specifically, the study investigated whether RD1 could predict antidepressant response to ketamine. TRD participants showed higher RD1 and shorter RL at baseline compared to HVs, as assessed via non-parametric tests, but Total Night RD did not differ between the two groups. Ketamine treatment decreased RD1 in TRD participants but did not affect Total Night RD or RL. As assessed via the Support Vector Machine (SVM) algorithm, baseline RD1 level moderately predicted antidepressant response to ketamine versus non-response (area under the receiver operating characteristic (ROC) curve (AUC) = 0.73, with a median accuracy of 0.75), wherein TRD participants with higher baseline RD1 were more likely to respond to ketamine. These results underscore the utility of RD1 for identifying individuals most likely to benefit from ketamine treatment, enabling more targeted and effective therapeutic strategies. Clinical Trials Identifier: NCT00088699, NCT01204918.