In the funeral games at the pyre of Patroclus he contended with Odysseus and Antilochus for the prize in the footrace; but Athena, who was hostile towards him and favored Odysseus, made him stumble and fall, so that he won only the second prize, On his return from Troy his vessel was wrecked on the Whirling Rocks (Γυραὶ πέτραι), but he himself escaped upon a rock through the assistance of Poseidon, and would have been saved in spite of Athena, but he said that he would escape the dangers of the sea in defiance of the immortals. In punishment for this presumption, Poseidon split the rock with his trident, and Ajax was swallowed up by the sea.
In later traditions this Ajax is called a son of Oileus and the nymph Rhene, and is also mentioned among the suitors of Helen. According to a tradition in Philostratus, Ajax had a tame dragon, five cubits in length, which followed him everywhere like a dog. After the taking of Troy, it is said he rushed into the temple of Athena, where Cassandra had taken refuge, and was embracing the statue of the goddess as a suppliant. Ajax violently dragged her away and led her to the other captives. According to some writers he even raped Cassandra in the temple. Odysseus, at least, accused him of this crime, and Ajax was to be stoned to death, but saved himself by establishing his innocence with an oath. The whole charge was sometimes said to have been an invention of Agamemnon, who wanted to have Cassandra for himself.
After his death his spirit dwelled in the island of Leuce. The Opuntian Locrians worshiped Ajax as their national hero, and so great was their faith in him that when they drew up their army in battle, they always left one place open for him, believing that, although invisible to them, he was fighting for and among them. The story of Ajax was frequently made use of by ancient poets and artists, and the hero who appears on some Locrian coins with the helmet, shield, and sword is probably this Ajax.