In Greek mythology heavily influenced by cultures from the East, Agdistis (Ἄγδιστις) was a powerful hermaphroditic daemon. Agdistis was chaotic, neither good nor evil, but impossible to control, containing all of the powers of creation within his/her body and using these powers to wreak havoc.
There are two stories concerning the origin of Agdistis. In the first, Zeus raped the goddess Cybele after she disguised herself as a rock, and Agdistis was conceived. In the second, Agdistis was born when Zeus dropped his semen upon the ground in his excitement over an unknown goddess that resisted his attentions, causing a rock or a mountain to become pregnant with Agdistis. Agdistis was named after this mountain (mount Agdos).
The Gods sought to stop Agdistis's uncontrolled destruction. To this end, Dionysus got Agdistis drunk by turning a spring into wine and Agdistis fell into a deep sleep. While Agdistic slept, Dionysus tied the daemon's male genitals to his/her legs or arms, then startled Agdistic awake. Leaping up in fright, the male genitals tore off. Where they fell upon the ground, an almond tree sprung up.
Deprived of these male parts, Agdistis was now a female divinity and became the great Mother Goddess Cybele.
Some time later, Nana, the daughter of a river spirit, came upon the almond tree and either eating an almond, placing it in her lap, or bringing it to her breast she became pregnant and bore Attis. She subsequently abandoned Attis to be found and raised by shepherds under the watchful eye of Cybele, who later would be his lover.
The people of Dyme have a temple of Athena with an extremely ancient image; they have as well a sanctuary built for the Dindymenian mother and Attis. As to Attis, I could learn no secret about him, but Hermesianax, the elegiac poet, says in a poem that he was the son of Galaus the Phrygian, and that he was a eunuch from birth. The account of Hermesianax goes on to say that, on growing up, Attis migrated to Lydia and celebrated for the Lydians the orgies of the Mother; that he rose to such honor with her that Zeus, being wroth at it, sent a boar to destroy the tillage of the Lydians.
Then certain Lydians, with Attis himself, were killed by the boar, and it is consistent with this that the Gauls who inhabit Pessinus abstain from pork. But the current view about Attis is different, the local legend about him being this. Zeus, it is said, let fall in his sleep seed upon the ground, which in course of time sent up a demon, with two sexual organs, male and female. They call the demon Agdistis. But the gods, fearing Agdistis, cut off the male organ.
There grew up from it an almond-tree with its fruit ripe, and a daughter of the river Sangarius, they say, took of the fruit and laid it in her bosom, when it at once disappeared, but she was with child. A boy was born, and exposed, but was tended by a he-goat. As he grew up his beauty was more than human, and Agdistis fell in love with him. When he had grown up, Attis was sent by his relatives to Pessinus, that he might wed the king's daughter.
The marriage-song was being sung, when Agdistis appeared, and Attis went mad and cut off his genitals, as also did he who was giving him his daughter in marriage. But Agdistis repented of what he had done to Attis, and persuaded Zeus to grant that the body of Attis should neither rot at all nor decay.
These are the most popular forms of the legend of Attis.