After Pandion died, the four brothers wrested control of Athens from the sons of Metion, who had driven Pandion from power. Though they divided the government in four, Aegeus became king. He took Meta as his wife, then Chalciope, daughter of Rhexenor.
Neither woman bore him an heir, so Aegeus began to fear losing his power. To solve this dilemma, Aegeus traveled to Delphi for advice from the Pythia. She gave him a cryptic prophesy in answer to his question: "Do not loosen the bulging mouth of the wineskin until you have reached the height of Athens."
On his way back to Athens, Aegeus rested a night at the town of Troezen. The king of Troezen, Pittheus, had a reputation for wisdom, so Aegeus asked him what he thought of the strange prophesy. Pittheus understood it completely; he caused Aegeus to become drunk, then introduced him to his daughter, Aethra. In the morning, Aegeus learned that she was Pittheus' daughter and understood what had happened. He told her that he would leave a sword and a pair of sandals under a great rock in Troezen; if she bore a son, he was to collect these things when he was old enough and travel to Athens. He asked her to tell her son to travel in secret, as Aegeus feared that the fifty sons of Pallas were plotting against him.
Aegeus returned to Athens and married the sorceress Medea. She convinced him that she could cure his childlessness, and eventually bore him a son, Medus. During this time, Aethra had born a son, Theseus, who was raised in Troezen by Pittheus. Aethra and Pittheus concealed his parentage, and Pittheus spread a rumor that the boy's father was actually the god Poseidon. When Theseus was a young man, Aethra led him to the rock and told him the truth about his father. Theseus lifted the rock easily, collected the sword and sandals, and made his way to Athens.
Medea learned that Theseus, the true heir, was coming to Athens. She told Aegeus that Theseus was an enemy and a pretender to the throne. She created a poison and persuaded Aegeus to entertain the stranger, and then give him the poison to drink. Still nervous about his power, Aegeus took her advice and prepared to give Theseus the poison. As Theseus put the cup to his lips, Aegeus recognized the sword and dashed the poison away. He rejoiced at the return of his son and drove Medea and Medus from the city.
The sons of Pallas had hoped to gain power when Aegeus died, so they went to war when Theseus was named the successor. Theseus defeated them quickly. Later, when Theseus went to Crete to try to defeat the monster there called the Minotaur, Aegeus feared that he would lose his son and become childless once more. Theseus comforted his father and told him that if he returned from Crete victorious, he would raise a white sail on the returning ship; otherwise, the sail would remain black.
Theseus did defeat the Minotaur, but he and his pilots forgot to raise the white sail as they returned to Attica. Aegeus saw the black sail as the ship approached, and thought that Theseus had been killed on Crete. In his grief, Aegeus threw himself from the Acropolis and died. Some say he threw himself into the sea and drowned, and the sea in which he died was called the Aegean thereafter.
Note: The ancient writers have a number of explanations for why Theseus forgot to change the sails:
Apollodorus (Greek, first- or second-century BCE) writes that as the ship stopped on the island of Naxos on the return to Athens, the god Dionysus carried off the princess Ariadne, with whom Theseus had fallen in love and taken from Crete. Theseus was bereft at the loss and in his sorrow forgot to change the sails.
Plutarch (Greek, second century CE) gives a number of stories on why Ariadne was left behind, but he says Theseus and his crew forgot the sails in their joy at having succeeded on Crete.
Catullus (Roman, first century BCE) gives Theseus the least credit of all. According to his poem, Theseus simply forgets about her and sails away after she falls asleep on Naxos. She wakes to realize she's been deserted, and calls on the Eumenides to punish him: "Do not permit my mourning to disappear; but with the same mind as Theseus left me alone, goddesses, may he defile himself and his own with death." So, with the same forgetfulness with which he abandoned Ariadne, Theseus forgets to change the sails and returns to Athens: "Thus, as he entered the chambers of the house defiled by the death of his father, brave Theseus himself received the same grief from his forgetful mind as he had brought to the daughter of Minos (Ariadne)."