Professor Moriarty starred in his own two-episode arc in Star Trek, and he was the center of one of Star Trek: The Next Generation's most interesting moral dilemmas. The character of Moriarty made his debut in the Sir Arthur Conan Doyle short story "The Final Problem" in 1893, and he would quickly become Sherlock Holmes's most famous villain. Known for being a criminal mastermind of almost infinite intellect, Moriarty became just as famous as his sleuthing adversary. The lore of the Sherlock Holmes series grew far beyond the pages of Conan Doyle's books, and the legacy of the characters lived well into Star Trek's 24th Century.

Star Trek was never limited by its own lore, and it often included classic pieces of literature, music, and art in its stories to connect it to Earth's distant history. Historical figures in Star Trek were always quite common, and almost every series featured stories that saw real or fictitious icons of the past arrive in the future. Professor Moriarty, though fictional, became a dynamic character during the events of Star Trek: The Next Generation, and his legacy only grew larger. Like his literary counterpart, Star Trek's Moriarty presented just as much of a challenge for the crew of the USS Enterprise-D as he did to Sherlock Holmes.

RELATED: How Is TNG's Moriarty Back In Star Trek: Picard Season 3?

Professor Moriarty Was A Hologram In Data's Sherlock Holmes Program

Moriarty smiles from Star Trek TNG

Star Trek: The Next Generation season 2, episode 3, "Elementary, My Dear Data," showed the Enterprise's resident android easily besting every one of his Sherlock Holmes holodeck programs because he already knew the endings. As such, La Forge then programmed a version that was capable of beating him, and the computer concocted its own Professor Moriarty, who quickly learned that he was on a holodeck and demanded to be allowed to exist in the real world. So much more than the usual holodeck run amok episodes that were common in Star Trek: The Next Generation, "Elementary, My Dear Data" explored the morality of hologram sentience for the first time.

Moriarty Returned In "Ship In A Bottle"

Moriarty talks to LT. Barclay in Star Trek TNG

Years after he first vexed the crew of the Enterprise in "Elementary, My Dear Data," Moriarty returned in Star Trek: The Next Generation season 6, episode 12, "Ship In A Bottle," and presented an entirely different challenge for the ship's crew. In the episode, Lt. Barclay accidentally accessed the protected memory file that contained Professor Moriarty, and he was reactivated. Much to the surprise and bewilderment of Captain Picard, Moriarty then revealed that he was aware of his previous experience and had actually lived the intervening years when he was deactivated in real-time. Demanding to be made real, Moriarty then seized control of the Enterprise.

The solution that the crew reached was to confine Moriarty in a simulation, and he was kept on a data cube, believing he was exploring the universe in a shuttlecraft. Not only was Moriarty a Star Trek guest character who stole the show, but he also presented one of the franchise's most vexing moral issues. The humanity of synthetic beings like Data was the subject of much debate during the series, and Moriarty's "I think therefore I am" dilemma was just as interesting. Later Star Trek shows would further explore the idea of holographic sentience, but the dastardly Moriarty was the first time the subject had been broached.