Hercules was married to Megara, the daughter of King Kreo of Thebes, and together they had five children. Unfortunately, the goddess Hera drove Hercules insane in a fit of jealousy and he killed his wife and children.
Driven mad by Hera (queen of the gods), Hercules slew his son, daughter, and wife Megara. After recovering his sanity, Hercules deeply regretted his actions; he was purified by King Thespius, then traveled to Delphi to inquire how he could atone for his actions. Pythia, the Oracle of Delphi, advised him to go to Tiryns and serve his cousin King Eurystheus for twelve years, performing whatever labours Eurystheus might set him; in return, he would be rewarded with immortality. Hercules despaired at this, loathing to serve a man whom he knew to be far inferior to himself, yet fearing to oppose his father Zeus. Eventually, he placed himself at Eurystheus’s disposal.
Eurystheus originally ordered Hercules to perform ten labours. Hercules accomplished these tasks, but Eurystheus refused to recognize two: the slaying of the Lernaean Hydra, as Hercules’ nephew and charioteer Iolaus had helped him; and the cleansing of the Augeas, because Hercules accepted payment for the labour. Eurystheus set two more tasks (fetching the Golden Apples of Hesperides and capturing Cerberus), which Hercules also performed, bringing the total number of tasks to twelve.