Variations on the legend of Oedipus are mentioned in fragments by several ancient Greek poets including Homer, Hesiod, Pindar, Aeschylus and Euripides. However, the most popular version of the legend comes from the set of Theban plays by Sophocles: Oedipus the King, Oedipus at Colonus, and Antigone.
Oedipus was the son of Laius and Jocasta, king and queen of Thebes. Having been childless for some time, Laius consulted the Oracle of Apollo at Delphi. The Oracle prophesied that any son born to Laius would kill him. In an attempt to prevent this prophecy's fulfillment, when Jocasta indeed bore a son, Laius had his ankles pierced and tethered together so that he could not crawl; Jocasta then gave the boy to a servant to abandon ("expose") on the nearby mountain Cithareon. However, rather than leave the child to die of exposure, as Laius intended, the servant passed the baby on to a shepherd from Corinth and who then gave the child to another shepherd.
The infant Oedipus eventually came to the house of Polybus, king of Corinth and his queen, Merope, who adopted him, as they were without children of their own. Little Oedipus/Oidipous was named after the swelling from the injuries to his feet and ankles ("swollen foot"). The word "oedema" (British English) or "edema" (American English) is from this same Greek word for swelling: οἴδημα, or oedēma.
After many years, Oedipus was told by a drunk that he was a "bastard", meaning at that time that he was not of the same blood to them. Oedipus confronted his parents with the news, but they denied this. Oedipus went to the same oracle in Delphi that his birth parents had consulted. The oracle informed him he was destined to murder his father and marry his mother. In an attempt to avoid such a fate, he decided to not return home to Corinth, but to travel to Thebes, as it was near Delphi.
On the way, Oedipus came to Davlia, where three roads crossed each other. There he encountered a chariot driven by his birth-father, King Laius. They fought over who had the right to go first and Oedipus killed Laius when the charioteer tried to run him over. The only witness of the King's death was a slave who fled from a caravan of slaves also traveling on the road at the time.
Continuing his journey to Thebes, Oedipus encountered a Sphinx, who would stop all travelers to Thebes and ask them a riddle. If the travelers were unable to answer her correctly, they would be killed and eaten; if they were successful, they would be free to continue on their journey. The riddle was: "What walks on four feet in the morning, two in the afternoon and three at night?". Oedipus answered: "Man: as an infant, he crawls on all fours; as an adult, he walks on two legs and; in old age, he uses a 'walking' stick". Oedipus was the first to answer the riddle correctly and, having heard Oedipus' answer, the Sphinx allowed him to carry on forward.
Queen Jocasta's brother, Creon, had announced that any man who could rid the city of the Sphinx would be made king of Thebes, and given the recently widowed Queen Jocasta's hand in marriage. This marriage of Oedipus to Jocasta fulfilled the rest of the prophecy. Oedipus and Jocasta had four children: two sons, Eteocles and Polynices (see Seven Against Thebes), and two daughters, Antigone and Ismene.
Many years after the marriage of Oedipus and Jocasta, a plague of infertility struck the city of Thebes, affecting crops, livestock and the people. Oedipus asserted that he would end the pestilence. He sent his uncle, Creon, to the Oracle at Delphi, seeking guidance. When Creon returned, Oedipus learned that the murderer of the former King Laius must be brought to justice, and Oedipus himself cursed the killer of his wife's late husband, saying that he would be exiled. Creon also suggested that they try to find the blind prophet, Tiresias who was widely respected. Oedipus sent for Tiresias, who warned him not to seek Laius' killer. In a heated exchange, Tiresias was provoked into exposing Oedipus himself as the killer, and the fact that Oedipus was living in shame because he did not know who his true parents were. Oedipus angrily blamed Creon for the false accusations, and the two argued. Jocasta entered and tried to calm Oedipus by telling him the story of her first-born son and his supposed death. Oedipus became nervous as he realized that he may have murdered Laius and so brought about the plague. Suddenly, a messenger arrived from Corinth with the news that King Polybus had died. Oedipus was relieved for the prophecy could no longer be fulfilled if Polybus, whom he considered his birth father, was now dead.
Still, he knew that his mother was still alive and refused to attend the funeral at Corinth. To ease the tension, the messenger then said that Oedipus was, in fact, adopted. Jocasta, finally realizing that he was her son, begged him to stop his search for Laius' murderer. Oedipus misunderstood her motivation, thinking that she was ashamed of him because he might have been born of low birth. Jocasta in great distress went into the palace where she hanged herself. Oedipus sought verification of the messenger's story from the very same herdsman who was supposed to have left Oedipus to die as a baby. From the herdsman, Oedipus learned that the infant raised as the adopted son of Polybus and Merope was the son of Laius and Jocasta. Thus, Oedipus finally realized that the man he had killed so many years before, at the place where the three roads met, was his own father, King Laius, and that he had married his mother, Jocasta.
Events after the revelation depend on the source. In Sophocles' plays, Oedipus went in search of Jocasta and found she had killed herself. Using the pin from a brooch he took off Jocasta's gown, Oedipus blinded himself and was then exiled. His daughter Antigone acted as his guide as he wandered through the country, finally dying at Colonus where they had been welcomed by King Theseus of Athens. However, in Euripides' plays on the subject, Jocasta did not kill herself upon learning of Oedipus' birth, and Oedipus was blinded by a servant of Laius. The blinding of Oedipus does not appear in sources earlier than Aeschylus. Some older sources of the myth, including Homer, state that Oedipus continued to rule Thebes after the revelations and after Jocasta's death.
Oedipus' two sons, Eteocles and Polynices, arranged to share the kingdom, each taking an alternating one-year reign. However, Eteocles refused to cede his throne after his year as king. Polynices brought in an army to oust Eteocles from his position and a battle ensued. At the end of the battle the brothers killed each other after which Jocasta's brother, Creon, took the throne. He decided that Polynices was a "traitor," and should not be given burial rites. Defying this edict, Antigone attempted to bury her brother. In Sophocles' Antigone, Creon had her buried in a rock cavern for defying him, whereupon she hanged herself. However, in Euripides' lost version of the story, it appears that Antigone survives.