The Megans, a group of aliens from Megas-Tu who tried to help Humans with the art of wizardry, settled in Salem after realizing that Humans only wished to use them to serve greed and lust. They chose to live their lives there as "normal men" to avoid the accusations of being "devils, warlocks and evil sorcerers." Unfortunately, while living in Salem, several of the Megans made mistakes and used their powers, and were "burned for it as witches."
In 2269, the USS Enterprise made contact with the Megans, but due to the Megans distrust of Humans, the Enterprise crew was placed in a recreation of a Salem witch trial. (TAS: "The Magicks of Megas-Tu")