The worship of the animal-headed Set dates back to the Predynastic Period of ancient Egypt. The son of Nut and Geb, Seth was the brother of Horus, Nephthys, Isis and Osiris, with whom he played out dramatic scenes of sibling rivalry over their sister Isis and the throne.
The third son of the union of Geb and Nut, Set was the lord of evil. Jealous of his eldest brother Osiris, the beloved ruler of the land, he tricked him into lying in a beautiful chest he'd had made, and then with 72 co-conspirators, sealed it and threw it into the Nile. Soon after, a tamarisk tree sprouted from it.
According to custom, Osiris had married his sister Isis. She knew of Set's wickedness and jealousy. Suspecting foul play, she put her baby Horus in the care of the cobra goddess Buto/Wadjet and set out to look for the body of her husband. He needed a proper burial to reach the underworld.
After long travels, and with the help of Queen Astarte (Ishtar) of Byblos, she found him. Though Isis hid her husband's coffin in the reeds of the Nile delta, Set was on a boar hunt, and by luck, spotted and recognized the chest he had used to murder his brother. Enraged, he tore it open and wrenched the body of Osiris into fourteen pieces.
At this point, Nephthys, who had been Set's consort, left him to help her sister. In the guise of a jackal, her son Anubis assisted with the search. Slowly, Isis recovered and reassembled thirteen of the fourteen fragments of her husband's body. Using her magic, she created a replica of her husband's genitals, the missing piece that had been eaten by impious fishes, and re-formed his body ready for the burial rites.
Meanwhile, she had created shrines at the thirteen places where is body parts had been found, so his final resting place would remain uncertain and he couldn't be desecrated again.
After this, Osiris ruled in the underworld. He came often in visions to his growing son Horus, and told him he had to avenge his father's death by making war on Set. The last battle in this long war took place at the First Cataract, where Set transformed himself into a huge red hippopotamus. With one harpoon blow to the brain, Horus killed his evil Uncle Set.
At Edfu, the place of the battle, a temple was dedicated to Horus. Thereafter, the Egyptians buried their dead pharaohs beneath pyramids, where their bodies could not be disturbed.