In the TARDIS, the Fourth Doctor and Adric arrive back in N-Space in an area known as the Traken Union, an empire of peace and harmony. They are surprised to find a holographic image of the elderly Keeper of Traken appear in the TARDIS, calling on the Doctor's help. The Keeper explains that his title is about to pass on soon to Consul Tremas, giving him access to the powerful Source that is the centre of Traken's technological advancement, but senses evil within him, his wife Kassia, and his daughter Nyssa. The Keeper suspects a connection to Melkur, an evil creature that arrived years ago on Traken but became calcified in a grove in the capital. Melkur has since become something of a holy symbol, and Kassia has been tasked with talking to it and keeping it clean; that task is soon to be passed on to Nyssa.

Melkur, as shown at the Doctor Who Experience.

When the Doctor and Adric land at Traken's capital and visit the Keeper, their presence appears to cause the Keeper to warn the assembled group of a great evil, and though Tremas vouches for them, others, including the Fosters, guardians of the spiritual welfare of the capital, remain cautious about their presence. Soon, bodies in the grove are found, the Doctor and Adric determining they have been killed by some type of plasma weapon. Adric works with Nyssa to identify the energy signature of the plasma as being from a TARDIS, while the Doctor assists Tremas in defusing the conflict over their presence. Unbeknownst to either group, Kassia secretly visits Melkur, who gives her a collar to wear, providing the creature with mind-control over her while promising to keep her husband safe. Kassia is able to convince the Fosters to arrest Tremas, the Doctor, Adric and Nyssa, and uses the situation to convince the other Consul to install her as the next Keeper. When the Keeper dies, Kassia takes the throne, but as the pivotal moment of the ceremony is completed, she disappears, leaving the statue of Melkur in her place, now connected to the Source.

Having escaped their confinement, the Doctor and his allies seek to cause a servo-shutdown of the Source to destabilise it and disconnect Melkur from using it. As Adric and Nyssa prepare to activate it, the Doctor is drawn into the statue of Melkur, finding it to be a TARDIS. Inside, he meets his old enemy, a horribly disfigured Master. The Master reveals he is on his last regeneration, and seeks to use the Source to give him a new set of regenerations, and then attempts to subdue the Doctor. However, at the same time, Adric and Nyssa initiate the servo-shutdown, disconnecting the Source from the Master and causing his TARDIS to malfunction. The Doctor escapes the Master's TARDIS, and when Melkur disappears, another Consul, Luvic, takes the throne to restabilise the Source before it completely dies.

After assuring all is well, the Doctor and Adric depart in his TARDIS. Later, Tremas discovers an alien longcase clock, and is transfixed to it when the Master emerges from it and merges his body with Tremas'. The newly reformed Master laughs as he re-enters the clock—his TARDIS—and dematerialises, leaving Nyssa wondering where her father has gone off to.

This story came about when the script editor suggested to Johnny Byrne that he use the subjects of millennialism and the effects of a long-serving head of state dying. The producer wanted to include a character that would give a sense of familiarity when Tom Baker, who had been the Doctor for several years, left and the new lead actor took over. To this end the Master replaced the villain in Byrne's draft.[1]

The story was repeated on BBC1 (except BBC1 Wales) across four consecutive evenings from Monday to Thursday, 10–13 August 1981, achieving viewing figures of 5.2, 4.4, 5.2 and 5.0 million viewers respectively.[4]