As the TARDIS arrives on Earth in its future, Adric argues with the Doctor about the lack of attention and respect he receives compared to Nyssa or Tegan, and wishes to return to his home planet Terradon, a feat the Doctor claims is impossible. As the group explores a series of caves, they are caught by Lieutenant Scott and his men who detected their arrival. Scott accuses the group of killing the rest of Professor Kyle's exploration team as they search the caves for fossils. The Doctor convinces Scott to let them help and points them to a debris of rock, where they find the bodies of Kyle's team, along with an odd metal hatch. As the Doctor examines the hatch, other men in Scott's force are killed by androids, undetectable by the humans' equipment. The Doctor is able to stop them, but the androids are able to send the Doctor's image back to their masters, the Cybermen, who recognize their foe. The Doctor is able to open the panel revealing a powerful bomb that could destroy the planet, and orders Nyssa and Tegan to return everyone to the TARDIS while he and Adric work at deactivating it.
The Doctor uses the signal sent to the androids and the bomb to trace it back to its source with the TARDIS, a freighter spaceship presently in Earth orbit awaiting to land after its cargo is inspected. The Doctor instructs everyone else to stay in the TARDIS while he and Adric explore it; the two are soon captured by the freighter's security forces when they happen upon the bodies of dead crew members, and are taken to meet Captain Briggs. Meanwhile, the Cybermen, hiding in one of the freighter's containers, decides it is time to take control of the ship, and begins an assault towards the bridge. Though the freighter crew, along with Tegan, Kyle, Scott, and his men, try to set up barricades, their defenses are foiled by Ringway, one of Briggs' helmsmen that has been working as a double agent for the Cybermen. Kyle is soon killed while Tegan is captured. The bridge is soon taken. The Cyber-leader reveals that the Doctor had foiled their initial plan—to wipe out much of the planet while several visiting dignitaries were present for a peace conference—but has a backup plan of crashing the freighter into the Earth, its anti-matter engines providing a similar devastating force. The Cybermen set the freighter on a high-speed collision course with Earth, and then affix a lock on the freigter's navigation controls to prevent the humans from tampering with it. The Cyber-leader, holding Tegan hostage, forces the Doctor to take them to the TARDIS to escape the doomed ship, leaving Adric, Briggs, and other crewmen behind under the guard of a few Cybermen; Adric hands the Doctor his Badge for Mathematical Excellence in case they will not see each other again.
Scott arrives to help Adric and Briggs defeat their guards, and Adric believes he will be able to decode the encryption to deactivate the lock. However, his attempt causes the freighter, the TARDIS still aboard, to jump in time, ending up approximately 65 million years ago. Aboard the TARDIS under the Cyber-leader's gunpoint, the Doctor reflects that this was the time that a large object had struck Earth and caused the extinction of the dinosaurs. Adric is able to disengage another part of the lock, taking the freighter out of warp but still on course to strike Earth. Briggs, Scott, and the remaining crew use the opportunity to use the ship's escape pods, but Adric refuses to leave, intent on defeating the lock. When Scott tried to communicate to the TARDIS that they were able to escape but Adric is still aboard, the Cyber-leader attempts to kill the TARDIS crew. The Doctor smashes Adric's gold-plated Badge into the Cyber-Leader's chest, momentarily stunning it, and the rest of the crew wrest control from the remaining Cybermen. The Doctor tries to pilot the TARDIS back to the bridge to rescue Adric, but the controls have been damaged during the fight. Adric is close to finishing the last lock seal when a damaged Cyberman attempts to fire on him. The shot misses Adric but strikes the lock, making it impossible to finish the task. The Doctor, Nyssa and Tegan watch helplessly as the freighter smashes into Earth with a massive explosion.
The credits roll in silence, with a close up of Adric's badge, broken up on the floor.