War elephants were considered untrustworthy by Greek military writers, but played an important role in many battles of the Hellenistic era, especially in the east. As was proven many times before, as well as in the wars of Pyrrhus of Epirus and Hannibal, elephants could throw a competent enemy battle line into confusion and win the day, as long as the enemy was not accustomed to battle against them. Yet, if used for a frontal assault, the danger of them being routed and falling in panic into the lines of their own army was great. As Livy attested, elephants were more dangerous when scared than when controlled. The Hellenistic generals were well aware of this fact and thus did not deploy them before or among their battle line, as was the case in Hydaspes or in Zama, both examples of how routing elephants could cost the battle. Instead, they were deployed on the wings, where they could keep the enemy cavalry at bay, protecting the infantry from a cavalry outflank. Against them, the enemy would use his own elephants, a necessity, since cavalry would never be able to conquer them. There, should they be defeated, they would have space to retreat without getting in the way of the infantry. Elephants would sometimes be accompanied by irregular infantry battalions, which would assist in the elephantomachia (elephant battle), while at the same time protecting their side from enemy infantry.