A total of 52 patients will be recruited for this trial. All subjects will be inpatients at Sunnybrook Health Sciences Centre with a diagnosis of either major depressive disorder or bipolar disorder type I or II currently depressed. Suicidal ideation must be present at baseline assessment in order to be included in the study. Thirteen subjects will be randomized to each treatment arm in each treatment stream - that is, 13 will be recruited to ketamine + TAU in the major depressive disorder stream, and 13 will be recruited to the midazolam + TAU in the major depressive stream. Likewise, 26 subjects with bipolar depression will be randomized to these two treatments.