Star Trek: The Original Series may have introduced Star Trek: The Next Generation's Q Continuum much earlier than believed through the trickster alien character Trelane (William Campbell). Introduced in the TOS season 1 episode "The Squire Of Gothos," Trelane was a playful but powerful alien who used the crew of the USS Enterprise as his playthings. Funny and theatrical, Trelane remains one of the most beloved adversaries from TOS, and his influence on the franchise would stretch much farther than just "The Squire Of Gothos."
Trelane was meant to be a one-off villain for Star Trek: The Original Series, as that show tended not to revisit its episodic antagonists. When the script for the two-part Star Trek: The Next Generation pilot episode "Encounter At Farpoint" by veteran Star Trek writer D.C. Fontana was running short, Star Trek creator Gene Roddenberry inserted a subplot involving Q (John de Lancie) an omnipotent alien who claims he's going to put Captain Jean-Luc Picard (Patrick Stewart) and his crew on a mysterious trial. That damaged Roddenberry's relationship with Fontana, but it resulted in a classic character. Early versions of Q had more than a little in common with Trelane.