Is an African elephant a predator or prey both?

African elephants (Loxodonta spp.) are generally considered to be primary consumers or herbivores, meaning they primarily feed on plants and vegetation for sustenance. However, in rare instances, they have been observed engaging in predatory behavior. Cases of elephants preying on other animals have been documented, though they are not typical and do not constitute a substantial part of their diet. When they do display predatory behavior, it's usually directed towards smaller species like dik-diks, young antelopes, warthogs, and even crocodiles. This behavior seems to be opportunistic rather than a regular hunting pattern. Therefore, while African elephants are primarily herbivores, they can occasionally exhibit predatory behavior, making them both predator and prey in certain contexts.