Lore

Lore is a villain from Star Trek who physically resembles the android Data and is in fact a creation of the same creator and by human standards would be considered Data's twin brother - however unlike Data, who is normally a curious but harmless individual Lore is a clever, manipulative and cunning individual who believes solely in self-preservation - she is also shown to be a jealous type and basically has many traits that humans traditionally associate with hostility or even evil.

History
When Lore was introduced in "Datalore", he gave two contradicting versions of his history when Picard wonders aloud who was created first, Lore answers, "He was, but they found him to be imperfect, and I was made to replace him." and then when he and Data are talking he says that he lied and he was created before Data, but it was because he was made perfect on the first try, and the colonists became envious of him and told Soong to create another "less-perfect android". Lore's real backstory was given in its entirety only later in the episode "Brothers", when his creator Dr. Noonien Soong stated that Lore was built before Data on the Omicron Theta colony, but that he was unstable emotionally and caused so much strife between the colonists that Soong had no choice but to deactivate him. Soong planned on repairing Lore after building and testing Data, but before he could do that the colony was destroyed by the Crystalline Entity and Soong was forced to flee. Unknown to Soong or the colonists at the time, it was Lore himself who had contacted and attracted the Crystalline Entity to the colony to destroy it.

Lore's remains were discovered in Soong's lab in the episode "Datalore", and he was rebuilt and reactivated. Although Lore initially appeared as inquisitive and harmless as Data, his true nature was gradually revealed during the episode. Lore secretly contacts the Crystalline Entity again, offering it the crew of the USS Enterprise as sustenance. However, Data foils his plans and transports Lore into space before the Crystalline Entity can attack, saving the ship.

In the episode "Brothers", Soong summons Data to Terlina III in order to give him an emotion chip. However, the same signal summons Lore, who had been found drifting in space and rescued by a group of Pakleds. Lore incapacitates Data and poses as him while Soong installs the chip. He then fatally wounds Soong before fleeing.

In "Descent, Part II", Lore revealed that he later encountered a group of Borg struggling with individuality following the Enterprise crew's actions in "I, Borg", and became their leader. Lore uses Soong's emotion chip to control Data until Geordi La Forge, Jean-Luc Picard and Deanna Troi manage to reactivate Data's ethical programming. Data shoots Lore at the end of the episode and then deactivates him permanently (retrieving his emotion chip afterwards). His final words to Data are "I love you... brother." and Data replies, "Goodbye, Lore."