The benefits of low-dose ketamine for patients with treatment-resistant depression (TRD) and prominent suicidal ideation require further investigation. The effects of treatment refractoriness, the duration of the current depressive episode, and the number of prior antidepressant failures on ketamine efficacy also require clarification. We recruited 84 outpatients with TRD and prominent suicidal ideation- defined as a score of ≥4 on Item 10 of the Montgomery-Asberg Depression Rating Scale (MADRS)-and randomized them into two groups to receive 0.5mg/kg ketamine or 0.045mg/kg midazolam. We assessed depressive and suicidal symptoms prior to infusion, 240min postinfusion, and 2, 3, 5, 7, and 14 days postinfusion. According to the MADRS scores, the antidepressant effect (p = .035) was noted significantly in the ketamine group up to 14 days than in the midazolam group. However, the antisuicidal effect of ketamine, as measured by the Columbia-Suicide Severity Rating Scale Ideation Severity Subscale (p = .040) and MADRS Item 10 (p = .023) persisted only 5 days postinfusion. Furthermore, the antidepressant and antisuicidal effects of ketamine infusion were noted particularly in patients whose current depressive episode lasted for <24 months or whose number of failed antidepressants was ≤4. Low-dose ketamine infusion is a safe, tolerable, and effective treatment for patients with TRD and prominent suicidal ideation. Our study highlights the importance of timing; specifically, ketamine is more likely to achieve therapeutic response when the current depressive episode lasted for <24 months and the number of failed antidepressants is ≤4.