Winters and Jellicoe gloat now that they have the upper hand. Kettlewell argues they should surrender if UNIT calls their bluff, but Winters informs him it's no bluff and tells him to start the countdown. Harry and Sarah Jane work on each others bonds to get free. Winters and Jellicoe go to the food supplies after checking up on Sarah Jane and Harry and not noticing anything amiss. As soon as they leave, the two get free.
The Doctor prepares for a suicide run to cut through the lock while the Brigadier's men provide a distraction. Kettlewell loses it and tries to stop the countdown, but Jellicoe draws a gun on him. Harry arrives to knock Jellicoe out and Kettlewell shuts down the count with 58 seconds to spare. They head for the outside door and get outside just in time. She tries to convince the robot not to shoot and the robot repeats that the soldiers must go. The robot's programming is overwhelmed and it insists it must kill them. Kettlewell intervenes and the robot shoots and destroys him. The robot goes berserk with grief then collapses and everyone goes into the bunker, after one UNIT soldier grabs the disintegrator gun.
Winters returns to see what happens and reactivates the countdown code. They take him out but with exactly two seconds left the Doctor manages to stop the countdown. While the Brigadier mops up, Sarah Jane wanders off and the robot confronts her. Benton reports that the robot has disappeared while Sarah Jane tries to convince the robot to surrender. The robot has decided it must destroy humanity and carryout it's creators orders, but will save Sarah Jane. He takes her to the control room.
Benton relates how he heard Kettlewell mention his anti-metal virus and the Doctor and Harry go to Kettlewell's lab to find it. Sarah Jane convinces the robot to ignore a soldier and gets the man to leave – he makes a hasty exit. The robot reactivates the countdown at 300 seconds and then throws off Sarah Jane when she tries to intervene.
The Brigadier checks in with the Doctor, who is trying to make an active solution of the virus. The Doctor realises that the robot has a suppressed Oedipus complex and will carry out Kettlewell's plan. The Doctor has the Brigadier contact the world powers which finish the emergency failsafe mechanism with only a few seconds left. The robot emerges from the bunker with Sarah Jane as the Doctor creates the active solution.
The Brigadier fires on the robot with the disintegrator gun – a bad mistake. Energised, it grows to enormous size and then picks up Sarah Jane. It walks to a nearby building and places Sarah Jane on the chimney, then goes to fight UNIT. The robot destroys some troops that open fire on it and the Brigadier orders a strategic retreat.
The Doctor and Harry arrive and after getting an update from the Brigadier, drive toward the robot and throw a bucket of the anti-metal virus on it. The robot first shrinks and then disintegrates into a pile of red dust.
Back at UNIT, the Doctor consoles a grief-stricken Sarah Jane and offers her a trip in the TARDIS. The Doctor is already feeling the pressure from the Brigadier and has no desire to stay. They're ready to take off when Harry barges in and points out that police boxes don't go careening through time and space. The Doctor offers him the chance to step inside and demonstrate it's an illusion, and Harry goes in and gets a bit of a shock. The Doctor and Sarah Jane quickly go in as well and the TARDIS departs just as the Brigadier arrives and realises they'll be a little late…