When the Persians arrived at Thermopylae in mid-August, they initially waited for three days for the Allies to disperse. When Xerxes was eventually persuaded that the Allies intended to contest the pass, he sent his troops to attack.[112] However, the Greek position was ideally suited to hoplite warfare, the Persian contingents being forced to attack the phalanx head on.[113] The Allies thus withstood two full days of battle and everything Xerxes could throw at them. However, at the end of the second day, they were betrayed by a local resident named Ephialtes who revealed to Xerxes a mountain path that led behind the Allied lines.