Depressive symptoms are often accompanied by cognitive impairments and recurrent depressive episodes are discussed as a potential risk for dementia. Especially, stressful life events are considered a potent risk factor for depression. Here, we induced recurrent stress-induced depressive episodes over the life span of rats, followed by cognitive assessment in the symptom-free period. Rats exposed to stress-induced depressive episodes learned faster than control rats. A high degree of stress-induced depressive-like behavior early in the paradigm was a predictor of improved cognitive performance, suggesting induction of resilience. Subsequently, exposure to lorazepam prior to stress-induced depressive episodes and cognitive testing in a nonaversive environment prevented the positive effect. This indicates a beneficial effect of the stress-associated situation, with the existence of individual coping abilities. Altogether, stress may in some have a beneficial effect, yet for those individuals unable to tackle these aversive events, consecutive unpleasant episodes may lead to worse cognitive performance later in life.