Searching for the last segment of the Key to Time, the Doctor and Romana arrive on the planet Atrios, which has just endured a bombing from the planet Zeos. The Marshal of Atrios (John Woodvine) is ready to launch a counterstrike, but the Doctor learns that Zeos is uninhabited, except for the giant computer Mentalis, which is running the war by itself, and that the real opponent is The Planet of Evil, ruled by something called the Shadow, an agent of the Black Guardian that the White Guardian warned the Doctor about. The Shadow takes captive Princess Astra of Atrios (Lalla Ward). He will torture her unless she tells him the location of the Key to Time, which she does not know.
After the Doctor saves K9 from being recycled, Romana and K9 help the Doctor to disable Mentalis, then he creates a substitute Key segment out of chronodyne, which gives the Key power to create a time-loop in which to trap the Marshal’s ship—in the last few seconds before it launches Armageddon--and the Mentalis control room—just before it self-destructs. On the Planet of Evil, he meets another Time Lord, Drax (Barry Jackson), who has been forced to work for the Shadow. He offers to help the Doctor. At one time or another, practically everyone comes under the spell of the Shadow—including K9.
The Shadow wants the Key and forces the Doctor to get it for him. He leads the Shadow’s servant, The Mute, to the TARDIS and opens the door. The Doctor is suddenly shrunk to tiny size by Drax, who then shrinks himself with the dimensional stabiliser from his own TARDIS. The Mute returns to the Shadow with the Key. Using their tiny size, the Doctor and Drax smuggle themselves into the Shadow’s lair inside K9. Drax returns them to normal size, the Doctor grabs the Key and the final segment—which is actually Princess Astra--and escapes. Astra, now knowing her destiny, is transmuted into the final segment, and the Key is whole.
The White Guardian appears. He congratulates the Doctor on finding the Key to Time and asks for it to be sent to him. But the Doctor has realized, because of the Guardian’s lack of empathy, that he is the Black Guardian in disguise as the White Guardian and orders the Key to disperse. To prevent the Black Guardian from killing him, he fits a randomiser into the TARDIS controls, which sends the TARDIS to an unknown place and time. The Guardian is unable to follow, but the Doctor now has no idea where they are going.
The idea of telling one story in 26 episodes, covering an entire season, did not work out as well as intended. There was little to tie the stories together other than the Key to Time McGuffin, and the fact that it finished with a somewhat lackluster story in six parts that might have worked better as four didn’t help. It seemed overly complicated to many viewers and a little boring, and the villain way over the top, laughing so maniacally that you expected him to start twirling his moustache. Mary Tamm was a bit disappointed with the role of Romana and wanted out by the time the last Key was found.