A dangerous alien power is at work, and the Doctor recognizes the mastermind of all this as Sutekh the Destroyer, the last of the Osirians. The Doctor must stop the ruthless Sutekh at all costs, or there may not be a future for them to return to.
Egypt, 1911. Marcus Scarman, Fellow and Professor of Archaeology at All Souls College, Oxford University, is excavating a blind pyramid and finds that the door to the burial chamber is inscribed with the Eye of Horus. Scarman's Egyptian assistants panic and flee at the sight of the glowing hieroglyph, leaving the Professor to enter the chamber alone. As he holds a light up to see the undisturbed tomb, he is blasted by a green ray that emanates from a seated and cowled figure.
The Fourth Doctor and Sarah Jane Smith are still on their way back to UNIT headquarters in the TARDIS. At the same moment as the tomb is disturbed, the TARDIS is forced out of its flight path and Sarah sees an apparition of an alien, jackal-like face in the console room. The Doctor comments that a mental projection that could have this effect on the TARDIS would be powerful beyond imagination. The Doctor follows the energy source back to its point of origin and lands the TARDIS in the Scarman family home, a former priory somewhere in England.
The Doctor and Sarah explore the priory and find what appear to be Egyptian artifacts in the storeroom in which the TARDIS materialised. Discovered by the butler, they are told that the house has been taken over by a mysterious Egyptian gentleman by the name of Ibrahim Namin. The butler urges them to leave. As he turns to inspect the room after the Doctor's and Sarah's departure through the window, a sarcophagus lid is seen to be moving.
In another part of the priory, Namin is being confronted by Dr. Warlock, an old friend of Professor Scarman, but their heated debate is interrupted by a scream. Warlock and Namin find that the scream has come from the butler, who has been strangled in the storeroom. Namin shoots Warlock in order to prevent him from going for help. The Doctor, who has witnessed the argument and heard the scream, prevents the shot from being immediately fatal by using his scarf to pull the gun in Namin's hand. The three make their escape into the grounds of the estate. Instead of following, Namin removes the lid of another sarcophagus to reveal a mummy. Holding up his ring, he commands the mummy to activate and orders it to pursue them.
The Doctor, Sarah and Warlock hide in the woods until the pursuing mummies are called off the hunt by Namin, who is summoned to the central room of the house by a blast of organ music. The three fugitives make their way to a hunting lodge in the grounds that is used by Laurence Scarman, Professor Scarman's brother, as a home. Laurence is an amateur scientist whose marconiscope has intercepted a signal from Mars. The Doctor uses a more portable device to decode the signal as "Beware Sutekh".
The Doctor explains that Sutekh is the last of a powerful alien race called the Osirians, a paranoid megalomaniac who came to believe that all life was his enemy. He was pursued across the galaxy by his brother Horus and was finally defeated on Earth by the combined might of 740 Osirians. The Doctor returns to the house in order to formulate a plan to stop Sutekh, followed by Sarah and Laurence Scarman.
Namin and the mummies — really service robots — greet the arrival of Sutekh's servant who travels to the priory via a spacetime tunnel, the portal of which is disguised as an upright sarcophagus. The Servant of Sutekh appears as a dark-helmeted humanoid figure dressed in black. The Servant ignores Namin's pleas for his life and kills him, declaring that Sutekh needs no other servant.
After killing Namin, the Servant transforms into Marcus Scarman, although he appears to be an animated corpse. Scarman then uses the spacetime tunnel to communicate with Sutekh, immobile in his pyramid, who orders Scarman to secure the perimeter of the estate and to construct an Osirian war missile. After Scarman and the robots leave to execute their orders, the Doctor, Sarah and Laurence Scarman enter the main room. The Doctor finds the spacetime tunnel but accidentally activates it and is nearly dragged through. He disrupts the tunnel using the TARDIS key and is knocked unconscious by the energy discharge. Laurence hides the three of them in a priest hole for fear of being discovered by his brother.
In another part of the estate, a poacher, Clements, finds a mummy trapped in one of his snares. He retreats but is prevented from escaping the estate by the deflection barrier that Sutekh has ordered to be generated in order to secure the perimeter. Once Scarman has finished placing the generators, he finds Warlock and questions him about the other people within the barrier. Clements hears Warlock's death scream and tracks Marcus Scarman back to the house.
While in hiding, the Doctor realises that he will be able to stop Sutekh controlling his Servant and the mummies by using Namin's ring and Laurence Scarman's scientific apparatus. Marcus Scarman is prevented from finding them by the sudden appearance of Clements. Clements fires his shotgun at Marcus Scarman's back and is amazed to see the explosion reverse and all damage healed. Clements panics and retreats, pursued by the robots.
The Doctor finds Namin's corpse and retrieves the ring. All three proceed into the TARDIS to avoid detection. Laurence is amazed by the dimensionally transcendental nature of the TARDIS. Sarah suggests they should just leave in the TARDIS, because they know that the world did not end in 1911. The Doctor demonstrates otherwise by moving the TARDIS forward in time to 1980. There, the TARDIS doors open onto a blasted wilderness, with thunder, rain and lightning hammering down on to ash fields. Sarah understands that they have no choice but to return to 1911 and stop Sutekh, or the future will be lost.
The TARDIS returns to 1911 and the three retreat to the hunting lodge in order to jury-rig a jamming unit to prevent Sutekh controlling his servants. Laurence finds it too hard to deal with the Doctor's assertion that Marcus Scarman is dead and that the being with his appearance is just a puppet. Laurence overhears the Doctor telling Sarah that when the jamming device is activated, all of Sutekh's servants will stop, Marcus Scarman included.
At the crucial moment when the device is activated, Laurence attempts to stop it from happening. The robots overrun the hunting lodge after finding and killing Clements. They knock Laurence out and throw the Doctor to the floor...
One of the robots attacks the jamming device and is disabled by a sudden discharge of power. Sarah is threatened by a robot, but the Doctor tells Sarah to grab the ring that they took from Namin and order the robots to return to Control. Sarah does so and the robots obey.
Surveying the ruined equipment, the Doctor decides that the only thing that he can do is to blow up the partially assembled rocket in the stable courtyard of the Priory. Laurence suggests using blasting gelignite, a supply of which Clements keeps in his hut on the estate. The Doctor and Sarah leave to locate the gelignite, ordering Laurence to strip the bindings from the now deactivated robot left in the hunting lodge.
The Doctor finds the energy barrier and, with Sarah's help, deactivates a generator loop in order to get through. The deactivation is detected by Sutekh, who orders Marcus Scarman to investigate. Marcus finds Laurence in the hunting lodge. Laurence tries to make Marcus remember his childhood in order to revive his humanity, but fails, and Marcus tortures Laurence in order to find out more about the Doctor.
Sutekh interrogates the Doctor and discovers that he is a Time Lord from Gallifrey. Declaring that he will turn the Doctor into his plaything, Sutekh locates the TARDIS and decides to use it to transport Scarman to the Pyramids of Mars in order to deactivate the Eye of Horus, the force that is trapping him. The Doctor avoids being killed by claiming that the TARDIS controls are isomorphic, meaning they respond to him alone. Sutekh subjects the Doctor to mind control and returns him to the priory as another of his servants. He then orders Scarman to bring a robot and Sarah into the TARDIS to travel to Mars.
On Mars, Sutekh orders Scarman to dispose of the Doctor and the robot throttles him. Scarman and the robot then find the way out of the first chamber beneath the pyramid and leave Sarah weeping over the Doctor. The Doctor then wakes up, revealing that his respiratory bypass system allowed him to avoid death, and they then set off in search of Scarman.
The Eye of Horus is located at the end of a corridor beneath the pyramid. The corridor is divided in to a series of chambers and progress through the chambers is dependent upon solving logical and philosophical problems. Sutekh navigates Scarman and the robot through each problem with no deliberation but the Doctor and Sarah are slower. At the last puzzle, a transparent cylinder materialises around Sarah. The voice of Horus tells the Doctor that the chamber has two switches and that he is allowed to ask one question of one Guardian of Horus. The Guardians materialised at the same moment as the Crucible and are mummy robots swathed in gold bindings. There is not much time as Sarah has a limited air supply within the chamber and will suffocate unless he can find out from them which is the right switch to activate. One robot will always tell the truth and the other always lie, but which is which?
Since the Guardians are contra-programmed so that one will always give a false answer, the Doctor asks one Guardian, if he were to ask the other Guardian which were the life switch, which would the other indicate? The Doctor reasons that if the Guardian he asks tells the truth then it must indicate the death switch and that if it is the liar then it would still indicate the death switch. The Doctor presses the other switch and the chamber and Guardians disappear, freeing Sarah.
Scarman and the robot reach the chamber containing the Eye of Horus. Another Guardian of Horus appears and does battle with Sutekh's robot. Sutekh realises that he is moments away from freedom and channels all of his power through Scarman in order to destroy the Eye of Horus. Scarman momentarily transforms into the jackal creature Sarah saw earlier in the TARDIS and destroys the Eye before falling to the floor and decaying to dust in an instant. Arriving too late, the Doctor looks back and sees the bulkhead doors open one by one, revealing the TARDIS at the end of the corridor. He realizes that the time factor can still save them. The Doctor and Sarah return to the estate as Sutekh slowly gets to his feet and begins to travel to Earth.
When they arrive, the Doctor removes a module from the TARDIS and attaches it to a sarcophagus, the other end of the spacetime tunnel Sutekh is about to use to arrive on Earth. As Sutekh appears in the tunnel, the Doctor springs a "temporal trap," immobilizing Sutekh in the timestream and forcing Sutekh to a point 10,000 years in the future, killing him in the process. When Sarah asks how he knew he had two minutes to act, the Doctor revealed it was how long radio signals took to travel between Earth and Mars, and that the Eye was still holding Sutekh for that period.
As the Doctor and Sarah pack up and prepare to leave, a thermal imbalance in the time tunnel causes it to catch fire. The Doctor remembers that the UNIT headquarters was built on the remains of a burnt priory and the two decide to leave it alone, re-entering the TARDIS and dematerializing. Outside, the priory is consumed in flames.