Set (sometimes spelled Seth) is a deity found in the mythology of ancient Egypt usually depicted as the traitor among the Egyptian gods, his official titles are the god of chaos, desert, storms and foreigners. Originally Set was held in high regard due to his status a desert divinity but over the course of time would become increasingly negative until he became the demonic figure he is recognised as in modern mythology.
Set, was not originally the prime evil figure in Egyptian mythology, as that title belongs to Apep, the evil god of darkness. Apep fought against Ra, God of light, and Set was one of the gods who fought against him to protect Ra, giving him a similarity to the figure of Lucifer in Christianity who was an angel who fell from grace and became the Devil. Set becomes the antagonist in the Osiris myth, where he opposes his brother Osiris, who symbolized order, and his nephew Horus. While the Apep-Ra conflict was a depiction of the battle between light and darkness, the Set-Osiris/Horus depicted the battle between order and chaos.
In the 2016 movie Gods of Egypt, Set was portrayed by Gerald Butler as the main antagonist.
Set was born from the earth god Geb and the sky goddess Nut, along with his twin-sister Nephtys, who also became his wife. Nut and Geb also gave birth to the twins Osiris and Isis, who became the king and queen of Egypt. Set became jealous of his brother, and sought to usurp his throne. He eventually killed Osiris and dismembered him, spreading his corpse parts around Egypt. Isis, with the help of Nephtys, sougth to collect the parts of his husband's corpse, while Set became king. The two goddesses collect all parts, and, with the help of Thoth and Anubis, they resurrect Osiris for a brief period, enough for Isis to conceive their son, Horus.
Isis hides along with her son, so that she can raise him while protecting him from Set. Horus eventually reaches adulthood, and challenges Set for the throne. Their struggle drags for eight years, but Horus prevails. Set attempts to rape Horus after his defeat but Horus castrates him, while Set removes Horus eyes. At this moment Thoth steps in to mediate the conflict, restoring the two and declaring Set's defeat. As the conflict ends, the two deities reconcile, as Horus rules over the fertile regions of Nile while Set is given rule over the desert and the foreign lands. Horus finally reclaims the throne as the rightful king of Egypt, and gives his father Osiris a proper funeral, restoring him in his afterlife, as Osiris becomes ruler of the dead.
After this story came into circulation, the role of Apep was largely morphed into Set.