The Doctor arrives on Gallifrey, where he is accused of the assassination of the Time Lord President. Investigating with the aid of Co-ordinator Engin and Castellan Spandrell, he discovers that this is part of a plot hatched by his old adversary the Master.
Having used up all twelve of his regenerations, the Master is now a wizened husk. He is seeking to control the presidency in order to obtain the official regalia, the Sash and Rod of Rassilon, which are really keys to the Eye of Harmony, the source of all the Time Lords’ power.
The Doctor links his mind to the Amplified Panatropic Computer Net, containing the accumulated wisdom of the Time Lords, in the hope of tracking the Master down. In the virtual reality of the Matrix, he finds himself in a life-or-death struggle with a hooded opponent. The Doctor proves the stronger and his opponent is revealed as Chancellor Goth, the leading presidential candidate, whom the Master has been using as a puppet. Following his defeat, Goth dies.
The Master meanwhile seizes the Sash and Rod of Rassilon and starts to access the Eye of Harmony, located beneath the floor of the Panopticon meeting hall, in the hope of drawing off enough energy to enable himself to regenerate. The Doctor manages to stop him before Gallifrey is destroyed, and the Master falls down one of the fissures that have opened up in the floor.
The Doctor then departs in the TARDIS, unaware that the Master has survived his fall and escaped to fight another day.