Faraway galaxies, time travel, an iconic time machine, and an eccentric Time Lord — Doctor Who has had the makings of a perennially loved show right from 1963. Its 2005 reboot saw some legendary regenerations of the Doctor, but none more fascinating than the Thirteenth Doctor who is a woman (played by Jodie Whittaker).

RELATED: Doctor Who: 10 Most Iconic Scenes From The Show, Ranked

Doctor Who has always been ahead of its time, but it continuously revisits world-altering historical events that have happened in the past and gives them a "timey wimey" twist of its own. Here are the best episodes from the show that dipped into history, ranked by IMDb. Geronimo!

Demons Of The Punjab (6.4)

The Doctor oversees Prem and Umbreen's wedding.

Set on the eve of the Partition between India and Pakistan in 1947, this episode is the heart-wrenching story of Yaz's grandmother Umbreen, who was the first woman to get married in Pakistan. Things become weird when Yaz sees that young Umbreen's husband-to-be isn't the man who was her grandfather, but a Hindu man named Prem. Weirder still, an alien assassin race seems to be on the loose on the borders, killing people.

The episode follows the story of how Umbreen's first husband is killed by his own fanatic brother, and the Thirteenth Doctor discovers that the aliens no longer kill people, but dedicate their lives to being by the side of people who die alone. This episode has been a finalist for awards and received acclaim from critics.

Nikola Tesla's Night Of Terror (6.4)

nikola teslas night of terror doctor who

The Doctor follows strange energy patterns and arrives in America in 1903 with Yaz, Graham, and Ryan, bang in the middle of the ongoing feud between Nikola Tesla and Thomas Edison. Edison is good at business, patenting others' inventions and scaring them away from Tesla. Tesla is a genius who imagines the future a century earlier than anybody else (including Wi-Fi, remote control, alternating currents).

Tesla intercepts a signal from Mars, which turns out to be from a race called the Skithra which steals inventions from other planets for themselves. The Skithra want to kidnap him and have him build things, but with the intelligence of the Doctor and Tesla's Wardenclyffe Tower, they manage to save New York City.

The Eaters Of Light (6.9)

eaters of light doctor who

Doctor Who tackles another piece of history with élan, this time with the missing Roman legion of the 9th in 2nd century AD. Set in Aberdeen, Scotland, Bill, Nardole, and the Twelfth Doctor go in two different directions to figure out what really happened to the vanished legion.

Bill finds the Roman legion, while the Doctor and Nardole find the young group of Picts that the Romans were fighting against. Both are hiding from a "light-eating" monster that has killed most of their own. In typical heart-warming Doctor Who fashion, the time travelers broker peace between the opponents, and they together decide to defend the doorway that the monsters appear from till the end of time.

Rosa (6.9)

rosa parks doctor who

Another award-winning episode (BAFTA) from Doctor Who with a strangely low rating on IMDb, Rosa made fans tear up with the Doctor, Ryan, Yaz, and Graham arriving in Alabama in 1955. The state is rife with racial segregation at the time, and the companions themselves face haunting instances of racist aggression when they first arrive.

They attempt to stop Krasko, an inter-galactic racist, who is trying to prevent the Montgomery Bus Boycott from happening by thwarting Rosa Parks. The boycott was a milestone in the removal of racial segregation on buses, and consequently the whole country. The Doctor and her companions realize that their presence on the bus is essential towards making sure that Rosa Parks refuses to give up her seat to a white man on the bus, which is the catalyst to the historic event.

The Haunting Of Villa Diodati (7.1)

haunting of villa diodoti doctor who

The Doctor transports her companions to Villa Diodati in 1816, to the night that Mary Shelley gets the inspiration to write Frankenstein. What is supposed to be a night of literature and poetry with greats like Lord Byron in the house, turns into a horror movie with ghostly figures in the villa, shifting walls, and some creepy sleepwalking thrown in.

The haunting turns out to be the work of a half humanoid Cyberman named Ashad, who is after the Cyberium, which has been swallowed by Mary's future husband Percy. The Doctor has to make a harrowing choice for humankind, and Mary gets her inspiration for Frankenstein from Ashad.

The Shakespeare Code (7.7)

William Shakespeare with his hands on his waist in Doctor Who

Doctor Who explores the lost Shakespeare play "Love's Labor's Won" in this episode. David Tennant's Doctor meets the august playwright in 1599, near The Globe Theatre where many of his plays are performed, along with Martha.

RELATED: Doctor Who: The Top 10 Tenth Doctor Episodes, Ranked According to IMDb

They discover that Shakespeare is being bewitched by three witch-like aliens called Carrionites into writing a sequel of "Love's Labor's Lost" called "Love's Labor's Won", with certain words incorporated into it which would set free the entire Carrionite race free into Earth in the 1500s. The Doctor succeeds in saving the Earth, but every copy of the lost play vanishes with the witches.

The Unicorn And The Wasp (7.7)

the unicorn and the wasp doctor who

On the eve of Agatha Christie's mysterious ten-day-long disappearance, The Doctor and Donna find themselves at an English estate owned By Lady Clemency Eddison, where Christie is a dinner party guest.

What follows is a classic whodunnit, with murder, a case of mistaken identities, back-stabbing, poisoning, events from the past that affect the present, and a sad but murderous alien wasp — very much like Agatha Christie's own novels. Doctor Who's version of Christie's disappearance has to do with amnesia due to alien life forces, and fans love it.

The Fires Of Pompeii (8.0)

pompeii doctor who

The Doctor and Donna mistakenly arrive in Pompeii instead of Rome in 79 AD and realize that the catastrophic eruption of Mount Vesuvius, which converted the whole of Pompeii into a stony ghost town, was going to happen soon.

The episode features future companion Karen Gillan as a soothsayer who is part of a sisterhood that predicted the arrival of a man in a blue box who brings fire and death with him. Moreover, it also features the future twelfth Doctor Peter Capaldi as Caecilius (who was actually a man from Pompeii). The Doctor faces the moral dilemma of letting history take its course or rescuing the townsfolk.

Let's Kill Hitler (8.0)

nazi germany doctor who

The Eleventh Doctor faces Hitler in Berlin in 1938, while in the search for Amy and Rory's lost daughter Melody Pond. The catch is that he actually ends up accidentally saving the dictator from a bad fate at the hands of the Teselecta, the space justice department.

RELATED: Doctor Who: Ranking Every Companion From Worst To Best

This episode aims to paint a caricature of Adolf Hitler and ends up revealing some very important plot points about Melody Pond, River Song, and the day of the Doctor's death.

The Girl In The Fireplace (9.3)

The DOctor with the Girl in the fireplace in France in Doctor Who

In one of Doctor Who's most loved episodes, David Tennant's Doctor arrives on a defunct spaceship that contains curious time portals which lead to a certain French girl, Reinette. The Doctor forms a romantic bond with her over the years, only to realize that she is in fact Madame de Pompadour, the mistress and French noble in Louis XV.

The Doctor saves Reinette from being abducted by the androids who own the derelict ship but is unable to reach her before her natural death years later.

Vincent and the Doctor (9.3)

The Eleventh Doctor, Amy Pond, and Vincent van Gogh sitting together

Fans of Doctor Who unanimously agree that the Eleventh Doctor's visit to Vincent Van Gogh with Amy Pond is one of the most brilliant episodes created in Whovian history. The Doctor takes Amy to France in 1890, to meet the tortured Van Gogh, who is the object of ridicule in his town. Plagued with mental illness and poverty, his art is considered below average and he's blamed for an invisible monster that is killing people.

The Doctor and Amy take care of the monster with Vincent's help, but nothing erases Vincent's inner demons. In an emotional moment,  The Doctor takes Vincent into the future where his work is displayed and highly revered, to show him his impact on the world. Amy returns to the present expecting that Vincent would not have taken his own life once he had seen the future, but history remains unchanged.

NEXT: Doctor Who: 10 Best TARDIS Console Rooms, Ranked