WARNING: The following contains major spoilers for the latest episode of Doctor Who, “Nikola Tesla's Night of Terror,” which premiered Sunday on BBC.

Doctor Who's unique premise allows the series to be in the present in one episode, visit the future in the next and pay a trip to the past after that. While every time period has its own qualities, these trips through human history have allowed the titular Time Lord to share the screen with some famous figures. In fact, the Doctor has previously gone on adventures where he (or she) befriended Vincent Van Gogh, Edgar Allan Poe , William Shakespeare, Queen Elizabeth and Rosa Parks, among many others.

That trend continues in Season 12's latest episode, "Nikola Tesla's Night of Terror," where Jodie Whittaker's Thirteenth Doctor and her companions meet famous inventors Nikola Tesla and Thomas Edison. But the real surprise comes when the two heated rivals end up becoming allies against a common enemy.

RELATED: Doctor Who: Who, or What Is the Timeless Child?

Today, the rivalry between Thomas Edison and Nikola Tesla is well known. The famous Edison is the man who plenty of advances in technology during the 19th century were attributed to, such as the camera and the light bulb. However, the contributions of fellow inventor Nikola Tesla aren't as celebrated. He was a brilliant scientist whose ideas were well ahead of their time -- for example, he dreamed up ideas for the x-ray and wireless communication. However, a lack of funding led him to fade from the history books. Of the two, Edison had more of a mind for patents and business, which helped contribute to his success.

In "Nikola Tesla's Night of Terror," Tesla becomes the target of an alien race known as the Skithra after unknowingly answering their transmission from Mars. Soon, the Doctor, Yaz, Graham and Ryan all get involved in preventing the inventor from falling prey to the alien scorpions. This adventure in the early 1900s leads to the involvement of Tesla's rival, Thomas Edison. Although the two men are quick to bicker and argue over which is the better inventor, the episode does something surprising: it forges a bond between the pair.

RELATED: Doctor Who's New Master Reveals His Terrified Reaction To Being Cast

With the Skithra as a common enemy, Edison joins forces with Tesla and the Doctor to save the planet. It's actually inspired to see these two historical competitors team up. Although they loathe each other, they still have a certain amount of respect for one another and their craft.

The episode is meant to shine a light on the works and the genius of Nikola Tesla. For those who don't know him, this is a perfect introduction to one of the most unfairly overlooked minds of the 20th century.

Doctor Who stars Jodie Whittaker as the 13th iteration of the titular Time Lord. Whittaker is joined by co-stars Bradley Walsh, Tosin Cole and Mandip Gill in a series spearheaded by showrunner Chris Chibnall. The next episode is set to air on the BBC on Jan. 26. The new season and all previous 11 seasons will stream on HBO Max later this year.

RELATED: It's Official: The 13th Doctor Who Has Another Iconic Look