In Greek mythology, Orestes was the son of Clytemnestra and Agamemnon. His tale was documented in the play Oresteia, composed by the playwright Aeschylus.
The first part of Oresteia detailed Agamemnon's homecoming after the Trojan War. Waiting at home for Agamemnon is his wife, Queen Clytemnestra, who has been planning his murder. She desires his death to avenge the sacrifice of her daughter Iphigenia (who was sacrificed to appease Artemis during the war), to exterminate the only thing hindering her from commandeering the crown, and to finally be able to publicly embrace her long-time lover Aegisthus. Upon killing Agamemnon and his concubine Cassandra, Clytemnestra married Aegisthus and the two usurped Agamemnon's position as ruler. Orestes was largely absent during this part of the play, as he pursued education in Athens. Eight years later, Orestes returned from Athens at the same time and encountered his younger sister, Electra, before Agamemnon's grave. There, Orestes happily reunited with his sister after almost a decade apart. Through her, he learned that Clytemnestra and Aegisthus ruled the kingdom as tyrants, and was abusive to Electra. Wishing to confirm and do something about this, Orestes returned to the palace, acting as a dutiful son who had finally returned from his studies. To his horror, Electra's claims were true; she lived miserably, and it wasn't long before Orestes himself also became a target to his parents' physical and verbal abuse. On Orestes' twentieth birthday, he encountered the Oracle of Delphi, who relayed to him a message from Apollo, telling him that he must kill Clytemnestra and Aegisthus to avenge Agamemnon. This only strengthened the young man's growing resolve. Orestes did not hold much sentiment over Agamemnon, who he believed had abandoned him and murdered Iphigenia, but he believed that killing Clytemnestra and Aegisthus would save Electra from their abuse.
So Orestes continuously looked for opportunities to catch his parents off-guard. In front of them, he maintains his act as a dutiful son who would silently accept their abuse. Deep down, he cursed his parents and planned elaborate murder schemes to end them. When the opportunity arrived, Orestes wasted no time assassinating the two. Yet in her dying breath, Clytemnestra cursed her son, summoning the Erinyes, whose duty is to punish any violation of the ties of family piety, to torment him to his death. Wishing to spare his sister from the same fate, he fled the kingdom as the Erinyes drove him mad.
One day during his escape, Orestes found refuge in the temple of Apollo. Just before the Erinyes caught up to him, Apollo descended and used a spell to place the Erinyes in deep sleep, allowing Orestes to flee. Apollo explained that while he was the one who ordered Orestes to kill his parents, he does not have the authority to protect him from the consequences... although a certain other Olympian might be able to do that. Apollo told Athena of Orestes' plight, and she took up her role as an arbitrator to determine Orestes' innocence.
Athena invited Orestes and the Erinyes to the Acropolis of Athens, and organized what was said to be history's first judicial trial. Twelve Athenian citizens were randomly selected as jurors, with Athena herself as the thirteenth tiebreaker juror. Apollo served as Orestes' "lawyer" of sorts, arguing for his innocence. The Erinyes demanded their victim, while Apollo and Orestes pleaded the orders of Apollo, and citing Clytemnestra and Aegisthus' abuse towards their children. When the votes are counted, apparently the results were tied, until Athena herself voted for Orestes' acquittal, breaking the tie. Orestes left the Acropolis as a free man, reuniting with his sister, and forever grateful towards Athena and Apollo. On the other side, Athena recruited the three Erinyes under her wing and renamed them as the Eumenides. Athena then ultimately ruled that all trials must henceforth be settled in court rather than being carried out personally. It was said that this trial became the basis of Athens' judicial system for centuries to come.