The latest episode of Doctor Who, "Nikola Tesla's Night of Terror," is loosely inspired by a true story. Doctor Who season 12 traveled back to the past this week, allowing the Doctor an opportunity to cross paths with some more historical figures. This time round she found herself working with Nikola Tesla and Thomas Edison, rival inventors who had accidentally stumbled onto an alien invasion.

It seems that Nikola Tesla had unwittingly discovered a signal from an alien race of scavengers known as the Skithra. A hive race, the Skithra survive by stealing technology from other worlds and civilizations, and they destroy anyone who refuses to share their discoveries with them. Tesla made the mistake of attempting to send a signal back - and he caught the attention of the Skithra, who were in need of a mechanic.

Related: Doctor Who Writes Out Torchwood & UNIT With A Single Line

As unlikely as it may seem, this Doctor Who episode was loosely inspired by a true story. In 1899, Tesla really did hear some rhythmic sounds on a radio receiver, and he became convinced they came from another world. In Christmas 1900, Tesla wrote a letter to the Red Cross in which he wrote:

"I have observed electrical actions, which have appeared inexplicable. Faint and uncertain though they were, they have given me a deep conviction and foreknowledge, that ere long all human beings on this globe, as one, will turn their eyes to the firmament above, with feelings of love and reverence, thrilled by the glad news: 'Brethren! We have a message from another world, unknown and remote. It reads: one... two... three...'"

Doctor Who Yaz and Nikola Tesla

Just as in Doctor Who, Tesla became increasingly convinced that this signal came from Mars. As he wrote in a letter to the New York Times, published in 1910:

"Most certainly, some planets are not inhabited, but others are, and among these there must exist life under all conditions and phases of development. Personally, I base my faith on the feeble planetary electrical disturbances which I discovered in the summer of 1899, and which, according to my investigations, could not have originated from the sun, the moon or Venus. Further study since has satisfied me that they must have emanated from Mars. All doubt in this regard will soon be dispelled."

"Nikola Tesla's Night of Terror" presented Tesla as a prophet, foretelling the development of the modern world, but in this matter he was not correct. Those "feeble planetary electrical disturbances" have simply been forgotten by history - until now, when Doctor Who used them as the basis for its latest historical sci-fi adventure. Interestingly, one Tesla biographer, Tim R. Swartz, has claimed this was connected to Nikola Tesla's attempts to develop a powerful radio antenna to monitor thunderstorms. Granted, Swartz isn't necessarily a reliable historian and scientist, given he's also well known for his love of conspiracy theories (particularly about chemtrails). Still, this dovetails nicely with the latest episode of Doctor Who.

If "Nikola Tesla's Night of Terror" is to be believed, the Doctor did unwittingly leave Tesla with one gift: the Silurian beam weapon. Years later, during World War II, Tesla actually claimed to have invented a "death ray" that could change the course of the war. Unfortunately Tesla died in January 1943 in his hotel room at New York City; concerned that he could have been telling the truth, the US Government confiscated all his files. The FBI only declassified some 250 pages of Tesla's notes in 2016, and two further batches have since been released. Some of Tesla's files are still missing to this day, and presumably the Silurian weapon is being kept very secret indeed.

More: Who Is The Timeless Child? Doctor Who Season 12's Big Mystery Explained