Euripides' Electra was probably written in the mid 410s BC, likely after 413 BC. It is unclear whether it was first produced before or after Sophocles' version of the Electra story.
Years before, near the start of the Trojan War, the Greek general Agamemnon sacrificed his daughter Iphigeneia in order to appease the goddess Artemis and allow the Greek army to set sail for Troy. His wife Clytemnestra never forgave him, and when he returned from the war ten years later, she and her lover Aegisthus murdered Agamemnon.
Their daughter Electra was married off to a farmer, amidst fears that if she remained in the royal household and wed a nobleman, their children would be more likely to try to avenge Agamemnon's death. Although the man is kind to her and has taken advantage of neither her family name nor her virginity, Electra resents being cast out of her house and her mother's loyalty to Aegisthus. Agamemnon and Clytemnestra's son, Orestes, was taken out of the country and put under the care of the king of Phocis, where he became friends with the king's son Pylades.
Now grown, Orestes and his companion Pylades travel to Argos, hoping for revenge, and end up at the house of Electra and her husband. They have concealed their identities in order to get information, claiming that they are messengers from Orestes, but the aged servant who smuggled Orestes off to Phocis years before recognizes him by a scar, and the siblings are reunited. Electra is eager to help her brother in bringing down Clytemnestra and Aegisthus, and they conspire together.
While the old servant goes to lure Clytemnestra to Electra's house by telling her that her daughter has had a baby, Orestes sets off and kills Aegisthus and returns with the body, but his resolve begins to waver at the prospect of matricide. However, when Clytemnestra arrives, he and Electra kill her, leaving both feeling oppressive guilt. At the end, Clytemnestra's deified brothers Castor and Polydeuces (often called the Dioscuri) appear. They tell Electra and Orestes that their mother received just punishment but that their matricide was still a shameful act, and they instruct the siblings on what they must do to atone and purge their souls of the crime.