After a secret meeting in space with a group of mysterious aliens, the Fourth Doctor takes Leela to Gallifrey so he can claim the Presidency of the Time Lords. After his induction as Lord President, the Doctor inexplicably commands the force field around Gallifrey to be shut down. His alien coconspirators materialize, revealing the Vardans, telepathic invaders that can travel on any wavelength.
The Doctor has been planning a double bluff, working alongside them until he can place a time loop around their home planet. But when he springs his trap, the Vardans are banished, only to be immediately replaced by Sontarans! This fearsome clone race was also using the Vardans, but to conquer the Gallifrey. The invasion of the Time Lords has begun, led by Commander Stor. A fierce battle ensues across the Capitol and through the Doctor's TARDIS. With casualties on both sides, Stor is the only surviving Sontaran. The Doctor uses knowledge extracted from the Matrix by K-9 to construct a De-Mat gun, a very powerful weapon, only to be used as a last resort. The gun is destroyed in an implosion with a Sontaran weapon... killing Stor. As they prepare to leave, Leela announces that she wishes to stay behind, and K-9 elects to remain with her.