Interest in multimodal function optimization is expanding rapidly since real world optimization problems often demand locating multiple optima within a search space. This article presents a new multimodal optimization algorithm named as the Collective Animal Behavior (CAB). Animal groups, such as schools of fish, flocks of birds, swarms of locusts and herds of wildebeest, exhibit a variety of behaviors including swarming about a food source, milling around a central location or migrating over large distances in aligned groups. These collective behaviors are often advantageous to groups, allowing them to increase their harvesting efficiency to follow better migration routes, to improve their aerodynamic and to avoid predation. In the proposed algorithm, searcher agents are a group of animals which interact to each other based on the biological laws of collective motion. Experimental results demonstrate that the proposed algorithm is capable of finding global and local optima of benchmark multimodal optimization problems with a higher efficiency in comparison to other methods reported in the literature.