In the Middle Ages, the bandit Irongron and his aide Bloodaxe together with their rabble of criminals find the crashed spaceship of a Sontaran warrior named Linx. The alien claims Earth for his Empire then sets about repairing his ship, offering Irongron “magic weapons” that will make him a king in return for shelter. They strike a bargain, though Irongron remains suspicious.
The Doctor and Brigadier Lethbridge-Stewart are investigating the disappearance of several scientists from a top secret scientific research complex. They do not know Linx has used an Osmic Projector to send himself forward eight hundred years and has kidnapped the scientists then hypnotized them into making repairs on his ship. The Projector only lets him appear in another time for a brief period. While the Doctor investigates he meets an eccentric scientist called Rubeish and a young journalist called Sarah Jane Smith, who has infiltrated the complex by masquerading as her aunt. Later that evening Rubeish disappears and the Doctor uses the data he has gathered to pilot the TARDIS back to the Middle Ages, not realising new companion Sarah has stowed away on board.
Irongron has stolen his castle from an absent nobleman, and relations with his neighbours are appalling. Indeed, the mild Lord Edward of Wessex has been provoked into building an alliance against him and, when this is slow in developing, sends his archer Hal on an unsuccessful mission to kill Irongron. The robber baron is in a foul mood when a captured Sarah is brought before him. His mood improves when Linx presents him with a robot knight which is then put to the test on a captured Hal. The archer is only saved when the Doctor intervenes from afar, shooting the robot control box from Irongron’s hands. The ensuing confusion lets both Hal and Sarah flee, and they head for Wessex Castle.
Meanwhile the Doctor has realised both that Sarah is in the time period and has been captured, and also that she previously supposed him to be in league with Irongron. The next morning the robber baron and his troops assault the castle using rifles supplied by Linx but the attack is repelled by the Doctor’s cunning. The failure further sours the relationship between Linx and Irongron, which has deteriorated since the robot knight fiasco and the point at which the robber saw the Sontaran’s true visage beneath his helmet.