The Doctor is contacted by the White Guardian who tasks him with finding the six segments of the Key to Time. Joined by a young Time Lady named Romana, he begins his quest on the planet Ribos.
The Doctor returns to the city to keep an eye on the Graff, leaving Romana, K9 and Garron to search for Unstoffe and the first segment.However, Garron double crosses them and steals the tracer.
The Doctor and Romana's search for the third piece of the Key to Time leads them to a stone circle in Cornwall where they find signs of strange activity and meet the inquisitive Professor Rumford who tells them of a nearby sect of druids.
Rumford arrives just in time to save the Doctor from being sacrificed, allowing him and K9 to rescue Romana from the cliff face but he is confused when she claims that she was pushed by someone who looked just like him.
Assisted by Prof. Rumford and K-9, the Doctor builds a projector by which to enter hyperspace and rescue the kidnapped Romana, all of them all the while trying to avoid the bloodsucking Ogri stalking them.
Aboard a hyperspace prison ship, two justice machines called the Megara, known for swift verdicts and harsh punishments, arrest the Doctor for breaking an infraction, with trial and execution to be carried out immediately.
The Tardis materializes on the Earth-like planet of Tara. The Doctor goes fishing while Romana finds the fourth segment of the Key to Time but the powerful Count Grendel mistakes her for an android and brings her to his castle.
After Count Grendel kidnaps the real Prince Reynart, the Doctor suggests his android lookalike be crowned king in his absence. Back at the Count's castle, Romana is introduced to Princess Strella who looks exactly like her.
While the Doctor works on the android Prince Reynart's speech circuits, Count Grendel realizes that Romana is a friend of the Doctor and plans to lure him into a trap using an android with her face.
In a last attempt to take the throne, Count Grendel plans to have Romana wed to Reynart with the intent to kill him afterwards and take his place as her husband. When the Doctor arrives to foil his plan, the Count challenges him to a duel.
The Doctor and Romana land on the moon Delta III, home to the green-skinned Swampies and a small group of human colonists. Soon after arriving, Romana is taken by the Swampies who wish to sacrifice her to the mysterious squid-like Kroll.
The Doctor and company drop in on the planet Atrios, whose inhabitants are in an interplanetary war with their twin planet Zeos. Although Astra, Princess of Atrios, wishes for peace, the Marshal, her commander of the military, does not share her views. So, while the TARDIS is in orbit around the planet, the Marshal targets the Doctor for destruction.
Unable to escape with the Tardis missing, the Doctor, Romana and Merak return to the Marshal who has an unusual change of heart and asks the Doctor for help but it soon becomes clear that someone or something else is controlling him.
The Shadow kidnaps the Doctor and tries to secure the Key to Time, while the Marshal prepares for an all-out assault against Zeos. Meanwhile, the Doctor's companions try to locate the missing TARDIS.
With both K9 and Princess Astra under his control, the Shadow lures the Doctor and Romana to his planet where the Doctor reunites with his old Time Lord friend Drax.
Romana looks on as Princess Astra turns herself into the sixth segment of the Key to Time, giving the Shadow ultimate power. The Doctor and Drax arrive just in time but for the Doctor one final trial remains.