Behavioural flexibility plays a major role in the way animals cope with novel situations, and physiological stress responses are adaptive and highly efficient mechanisms to cope with unpredictable events. Previous studies investigating the role of stress responses in mediating behavioural flexibility were mostly done in laboratory rodents using stressors and cognitive challenges unrelated to the ecology of the species. To better understand how stress mediates behavioural flexibility in a natural context, direct manipulation of the stress response and cognitive tests in ecologically relevant contexts are needed. To this aim, we pharmacologically blocked glucocorticoid receptors (GR) in adult cichlid fish using a minimally invasive application of a GR antagonist. GRs blockade prevents the termination of the stress response, which we predicted to impair behavioural flexibility. After the application of the GR antagonist, we repeatedly exposed fish to a predator and tested their behavioural flexibility using a detour task, i.e. fish had to find a new, longer route to the shelter when the shortest route was blocked. While the latencies to find the shelter were not different between treatments, GR blocked fish showed more failed attempts during the detour tasks than control fish. Furthermore, reduced performance was accompanied by an increase of fear related behaviours. This suggests that blocking GRs plays an important role in determining perceived fear and resulted in an impaired behavioural flexibility. We confirm a causal role of terminating the stress response in mediating behavioural flexibility with potential consequences for an effective and adaptive coping with changing environments.