On the planet Tara is a feudal society, despite possessing electronic weapons and androids. Centuries ago, a plague killed nine tenths of the population. The peasants began to build robots to do the work and that sort of thing became peasants’ work that the nobles would not do. There is now a struggle for the crown. The rightful heir Prince Reynart (Neville Jason) is challenged by his cousin Count Grendel of Gracht (Peter Jeffrey), who has kidnapped Reymart’s beloved Princess Strella.
The TARDIS arrives, the Doctor and Romana (Mary Tamm) searching for the fourth segment of the Key to Time. The Doctor decides to go fishing, so Romana finds and transforms the segment by herself. She is attacked by a Taran Bear and saved by Count Grendel, who takes her to his castle. Since she resembles Princess Strella, he believes she is an android double and orders her disassembled. Just before her head is cut off, Grendel’s doctor and android engineer Madame Lamia (Lois Baxter) realizes she is real. So, she is locked in a dungeon.
The noble swordsmen Zadek (Simon Lack) and Farrah (Paul Lavers) have recruited the Doctor into Prince Reynart’s service. He is repairing an android copy of the Prince, to be used as a decoy while the real prince sneaks into the coronation chamber to be crowned. But Grendel strikes first, drugging the Doctor, Reynart’s men, and the Prince himself, whom he kidnaps. When the Doctor and the swordsmen recover, they decide to crown the android instead. The crown might go to Grendel if Reynart is not there on time. The real Reynart was wounded during his capture and is deathly ill, imprisoned with Romana, who acts as his nurse.
The Doctor and the others sneak the android prince into the throne room and the coronation begins, despite the android’s responses being a little less than perfect. Still, it manages to look like the Prince and say the requisite words, so it goes well, except when Princess Strella (Mary Tamm, of course) appears, the Doctor realizes she is an android and hits her over the head with the royal sceptre, popping her face off.
Grendel’s servant, Till (Declan Mulholland) arrives at the Reynart house and offers Romana to the Doctor at the Pavillion of Summer Winds. The Doctor accepts, knowing it is a trap. Grendel’s Android Maker, Madame Lamia, has made an android Romana programmed to kill the Doctor when he speaks. K9 detects the fake, however, and eliminates the threat, just as the real Romana escapes and rescues the Doctor. Grendel, under a flag of truce, offers the crown to the Doctor, destroys the Reynart android, and re-captures Romana. His plan is to have Romana pose as Strella and marry Reynart, then kill Reynart and marry Romana himself, making him King.
K9 helps the Doctor sneak into the castle via the moat and secret tunnels. He arrives just in time to stop the wedding and duels with Count Grendel with electro-swords. Grendel is, of course, the greatest swordsman in the kingdom and the Doctor’s style is totally undisciplined, but somehow works. The duel lasts for several minutes. Grendel is defeated and leaps into the moat to escape. Romana frees the real Strella, picking up a few needlework pointers in the process. Strella is reunited with Reynart, and the time-travellers leave with the segment of the Key to Time.
Mary Tamm, who plays Romana, Strella, Romana’s android, and Strella’s android, designed the purple outfit she wore, because the one provided was scratchy. Filming took place mostly at Leeds Castle in Kent. The story, of course, relied heavily on The Prisoner of Zenda. Count Grendel’s horse was played by a rather striking one-eyed horse name Winston, who was highly praised for his charm on camera.