The Doctor (Jon Pertwee) and Jo Grant (Katy Manning) visit Strangmoor Prison to study a new method of treating criminals, in which a device called a Keller Machine changes hardened criminals into childlike innocents. Professor Kettering (Simon Lack) is manning the device in the absence of Emile Keller himself. The Doctor is suspicious, even before a string of deaths, including Professor Kettering, while the machine is operating. It appears that personal phobias are triggered, including the Doctor’s fear of fire after his ordeal in the Inferno story.
Brigadier Lethbridge-Stewart (Nicholas Courtney) and UNIT are providing security for the World Peace Conference. Captain Chin Lee (Pik-Sen Lim), whose leader is dead is behaving strangely, apparently trying to sour relations with the US. She is under the influence of the Master (Roger Delgado), a time-lord trapped on Earth like the Doctor, and she uses the Keller machine against the US delegate, Senator Alcott (Tommy Duggan), who almost dies. Chin Lee is deconditioned by the Doctor and she tells him that Emile Keller is the Master.
At Strangmoor Prison, a riot has broken out and prisoner Harry Mailer (William Marlowe), who was supposed to be next for the Keller Machine, seizes control of the prison and—you guessed it—takes Jo hostage, but she helps the guards re-take the prison. The Master turns up and gives gas grenades to Mailer and the other prisoners. The Doctor returns and is kidnapped himself, and the Master turns the machine on him—stopping one of his hearts for a time. But the Master is gradually losing control of the alien mind parasite inside, and he needs the Doctor to help him control it. But the Doctor remains under lock and key with Jo. The machine turns on the Master and tortures him with visions of the Doctor laughing.
The Master intends to recruit the prisoners as a private army. They hijack a UNIT convoy and seize a Thunderbolt Nerve Gas Missile slated for destruction, to fire it at the Peace Conference and start World War III. Captain Mike Yates (Richard Franklin) is taken prisoner. The Brigadier believes the missile is at Strangmoor and invades the prison. UNIT forces take control and Mailer is killed, but the Keller Machine is growing more powerful and overcomes the Doctor’s restraints. The Doctor believes that Barnham, having once been changed by the Keller process, is without evil and is immune to its effects.
Yates contacts UNIT and tells them the Thunderbolt is hidden on an unused airfield nearby. The Doctor contacts the Master and offers an exchange—the dematerialization circuit he has stolen from the Master’s TARDIS for the missile. The Doctor tricks the Master, using the immune Barnham to take the Keller Machine to the airfield, and turning it on. The Master is rendered helpless, and the Doctor triggers the missile’s self-destruct program, destroying both the missile and the Keller Machine. But the Master kills Barnham and escapes with the dematerialization circuit. He calls the Doctor, taunting him.
The reason that so many characters are kidnapped all the time is that cliff-hangers are needed for these six- and seven-part serials. A good bit of the job of a Doctor’s companion, notwithstanding that she is often a mathematician or a scientist, is to be kidnapped by goons or chased by monsters, preferably in a mini skirt. Still, this story was a favorite of Katy Manning—she did grab a gun from a goon and shoot wildly at him, disrupting a prison riot so the guards could take over, which came as a complete surprise. This sort of impulsive behaviour became part of her characterization. When the BBC first hired her for the role, Pertwee suggested they consider a young woman he had met in the commissary, who had impressed him. They were talking about the same person. No prisons in the UK would allow the BBC to film inside, so they used Dover Castle, which proved a great location for a military assault. The RAF provided an impressive Thunderbolt Missile, but the shoot went over-budget with the helicopter. For a while, most of this serial existed only in black-and-white, but parts found in colour were used to restore colour to the rest. The Mind-control machine was inspired by A Clockwork Orange, and I suspect by the rehabilitation chair in the “Whom Gods Destroy” episode of Star Trek: The original Series. At one point, there is a brief excerpt of “The Devil’s Triangle”, a piece by King Crimson based on the Mars suite of Gustav Holst’s The Planets.