Aggregations in insects carry out diverse functions, and gregariousness may also act as an antipredatory strategy, especially when combined with warning signalling. Despite many studies focused on the antipredatory function of gregariousness, there are still aspects needing further investigation: What aspects of predator behaviour are affected by prey gregariousness? Which of the antipredatory effects of aggregations are linked with aposematic coloration, and which will also work for non-aposematic prey? Does gregariousness of an aposematic species affect its mimetic relationships? We have studied these topics in the firebug, Pyrrhocoris apterus (Heteroptera), an aposematic red-and-black true bug with moderate chemical defence. Firebugs alternate between solitary and gregarious lifestyles throughout the year. We used hand-reared great tits (Parus major) as naive predators, and subjected them to avoidance training with either solitarily or gregariously presented firebugs, followed by a memory test with solitary individuals. To test whether effects of gregariousness are specific for the aposematic firebugs, we tested another group of birds with brown-painted firebugs. Our results show that the gregarious lifestyle of the firebug is a part of its antipredatory strategy. Compared to solitary individuals, aggregations benefited in several ways, some exclusive for aposematic firebugs, others working irrespective of coloration. Aggregations induced greater innate wariness, leading to longer attack latencies and more cautious prey handling, including complete attack avoidance in some birds. Despite the fact that the birds mostly attacked only one or two individuals from an aggregation, they needed fewer trials to reach the avoidance-learning criterion than the birds learning to avoid solitary firebugs. Birds’ experience with firebug aggregations reduced the predation risk of subsequently encountered solitary individuals, as the birds hesitated longer before attacking a solitary firebug if their previous aversive experience had been with aggregations rather than with solitary individuals. Predators’ experience with firebug aggregations may compensate for the firebugs’ moderate chemical defence, and as a consequence, gregariousness may change the firebugs’ mimetic relationships with better defended red-and-black true bug species from quasi-Batesian to Müllerian.