Ancient Gallifrey was once ruled by a dynasty of seers who foretold the future; but now the seers are dead, and only a fragment of their prophecies remains. As foretold by the Fragment, the scientists Rassilon and Omega (and one other) pilot a fleet to the ancient star Qqaba, watched by a woman who awaits her lover’s return. The Hands of Omega transform Qqaba into a source of unimaginable power -- but the Fragment is a forgery to maintain public support for Rassilon’s desperate plan, and, secure in the knowledge of his survival, Omega has miscalculated and his vessel is too close to the star when it detonates. His ship is destroyed in the supernova, and only Omega survives, immortal and bound within a stasis halo -- trapped behind the event horizon when the star collapses into a black hole...
Many ages later, on the world of the Time Lords, Chancellory guards Raimor and Peltroc stumble across a break-in in the archival vaults, and take the evidence to that most iconoclastic of the High Councillors -- a former renegade known as the Doctor. The casket which was nearly stolen contains nothing more than a set of circuits, keys, a piece of paper on which the word WHO is written (or OHM, depending upon which way the paper is held); but apparently nothing important. Raimor and Peltroc go off duty, but once back in his quarters, Peltroc is kidnapped by a masked figure wielding a force knife, and taken to Low Town. There, the figure’s criminal contacts supply him with drugs which will break down Peltroc’s telepathic defenses, and the figure questions him about the keys from the casket. Peltroc is able to overpower and kill the two criminals holding him prisoner, but the masked figure escapes.
The Time Lords are more occupied with a peace conference between Sontarans and Rutans from the distant future, to be held on Gallifrey at the Doctor’s instigation. General Sontar himself arrives on Gallifrey, along with a representative of the Rutan Host -- but while studying the record of the fleet’s arrival, a young Technician, Waym, detects an irregularity. He contacts his friend, the newly invested Time Lady Larna, who worries that the irregularity -- a possible breach in spacetime -- may mean that the alien fleets aren’t all that they seem, and that the Doctor -- who has gone to greet the arrivals in person -- is in danger. She rushes off to warn him, leaving Waym alone with Savar -- a mad Time Lord who was tortured by aliens while exploring away from Gallifrey, and who returned claiming to have seen God after falling off the edge of the Universe.
Larna finds the Doctor unharmed, but he is too occupied with greeting the new arrivals to pay attention to her warning and sends her to his quarters to wait. There, she finds a Zero Room devoted to his lost love, and when he returns she has forgotten what she wanted to say to him. The next day, the Doctor opens the conference, but it is soon apparent that the war is escalating. The Rutans have developed a device which can destroy planets by converting matter to anti-matter, and the Sontarans, in response, are developing a weapon capable of snuffing out a star. The Doctor confiscates the Rutan device, which the Sontarans have captured and brought as evidence; but it seems apparent that the hatred between the two races is too deeply entrenched to end.
Waym is found murdered in the Infinity Chambers, and the Magistrate -- an old friend of the Doctor’s, a bearded Time Lord who often dresses in black -- finds Larna in the Doctor’s quarters and questions her. Larna shows the Magistrate the irregularity Waym had discovered, and he reports it to the High Council -- who realize that it is a genuine breach in spacetime which is affecting the Universe on a quantum level. The Effect could make it possible to alter the very nature of reality, and if anyone finds the source and learns how to control it, they could pose the greatest ever threat to the Time Lords. Meanwhile, Larna confronts Savar, who was the last to see Waym alive -- but at that moment night falls, and Savar transforms into a version of himself from an alternate timeline. This eyeless, homicidally mad Savar forces Larna to take him to the Doctor’s quarters, where he is finally able to seize the keys he attempted to steal the night before.
The Doctor has heard about the Effect but is still too busy dealing with the Sontarans and Rutans to worry about it. Following through on a remark of Larna’s, he builds a prototype Timescoop which he activates within a “borrowed” TARDIS, and kidnaps General Sontar and the Rutan representative from their quarters. Sontar is furious and tries to kill the Doctor, but within the TARDIS’ state of temporal grace this is impossible. The Doctor takes Sontar and the Rutan into their future to show them the inevitable result of their war... but much to his and their horror, they find only a grey void. The Universe has been destroyed. Finally taking the Effect seriously, the Doctor returns to Gallifrey, but on the way back receives a distress call transmitted from Savar’s stolen TARDIS by Larna. He sets off to the rescue, leaving Sontar and the Rutan locked in his deactivated TARDIS.
The Time Lords locate the source of the Effect in the distant future, just a few decades before Event Two, the end of the Universe. The President authorises the activation of a timegate, and the Time Lords’ great Station is sent through to the dying Universe; there, they find a light-year-long Needle of matter sticking out of a black hole, an artificial construction with more inhabitable space than a Dyson sphere. Meanwhile, the Doctor rescues Larna from Savar just as dawn breaks and Savar returns to “normal”. When Savar was young, he set off on a mission to rescue Omega from his eternal prison, but within the black hole he met Ohm, mad god of the Time Lords, who offered him power over everything in existence. The terrified Savar tried to flee, but Ohm caught his TARDIS in the event horizon of the black hole, and while trying to escape it stretched out to over a light year in length. Savar fled in an escape capsule only to be captured by crystalline aliens who stripped his capsule of all advanced technology and even cut out his eyes. He has never recovered from his ordeal -- but he is still sane enough to know that the Effect is an indication that Ohm is once again trying to escape.
The Doctor, Larna and Savar try to warn the Council of the danger, but the revelation that Omega may be trapped within the black hole only makes the Time Lords more determined to control the Effect and free him. Savar stabs the President with a force-knife, hoping to delay the rescue attempt by putting him out of action. Before being taken to hospital to recover, the President names his acting successor -- and, suspecting that the Doctor has an ulterior motive for wanting to keep the Time Lords away from the Needle, he names Castellan Voran. Voran, who has never liked the Doctor, ignores his objections and orders the Time Lord Norval to land on the Needle -- but Norval’s TARDIS is destroyed by a weapon which is fired at the place at which his TARDIS is going to be, apparently before it is detected. Voran overreacts and prepares to unleash the Time Lords’ ultimate weapon down the timegate, but the Doctor and Larna, fearing that Voran is about to start a war which could end the Universe, manage to get to the power control room and shut down the timegate. Before it collapses, the Doctor tries to leap through, but Larna tries to stop him, realizing that he intends to use the Effect to change history and bring his beloved back to life. The Doctor stabs her in the primary heart to delay her -- but she deliberately twists in position so the stab wound will kill her. The Doctor nevertheless leaps through the timegate seconds before it closes, leaving Larna’s dead body behind him.
The collapse of the timegate cuts the Station off from its power source on Gallifrey, but the Doctor suggests that the Magistrate capture one of the dying Universe’s many black holes as an alternate source of power. The Doctor then uses a transmat bracelet to get down to the Needle by phasing through one of the alternate timelines where the defenses don’t work. Upon arrival he meets the Needle People, who only remember the future and who inform the Doctor that he will remain asleep all night in a self-induced coma before being rescued by two other Time Lords, a man and a woman. The Doctor, while pondering how to get past them, finds a history book of the future and is appalled by what it predicts for Gallifrey; but that is all yet to come and there may be a way, he hopes, of stopping it...
The Doctor rewires his transmat bracelet to send himself elsewhere without destroying his original body, thus creating a duplicate who places himself in a self-induced coma. The other Doctor then hides and follows one of the Needle People, Helios, to the door behind which rests the mad god of the Universe of anti-matter. Helios warns the Doctor that passing through this door will set in motion a terrible chain of events -- even if the Universe survives the threat of the mad god it may not survive the trials to come. Nevertheless, the Doctor uses the confiscated Rutan device to transform himself into anti-matter and pass safely through the doorway, and on the other side, he finds paradise. Waiting for him here is his lost love, the last of the Womb-Born of Gallifrey, who lived in the House of Lungbarrow for centuries before meeting him and bearing his children. And here, he meets Omega, trapped in the anti-matter Universe for uncountable millennia, and granted omnipotence by taming the power of singularity to his will.
Omega demonstrates his power by changing history so that the Doctor never killed Larna, although the Doctor still feels the guilt of his action. But despite Omega’s omnipotence he is still trapped, as the escape route can be opened by his willpower alone, and his body has decayed to nothing over the billenia. Not only does he need someone to take his place here, he needs a body to possess on the other side. However, as the black hole evaporated over the course of billions of years, Savar’s trapped TARDIS was able to slip its bonds and emerge from beyond the event horizon, and Omega has used it to focus the Effect through spacetime, changing history and setting up a sequence of events which would lead to his escape. Now the Doctor is here, reunited with the love of his life in a world he will never wish to leave -- and he has left a duplicate body on the other side of the black hole, ready for Omega to possess...
The Time Lords reopen the timegate and send Larna to the Station, and she and the Magistrate manage to convince Voran that the situation is under control. They go to the Needle to rescue the Doctor, just as predicted, but while they are there Omega passes into this Universe and causes the Magistrate to vanish when the Magistrate refuses to serve him. Larna agrees to help Omega return to Gallifrey, but once there she realizes that Omega intends to evaporate the event horizon around the Eye of Harmony, exposing the naked singularity and thus gaining omnipotence in the real Universe. The Sontarans have realized by now that Sontar is missing and accuse the Time Lords of kidnapping their leader, just as the power drain causes the planet’s defense grid to go down. The Sontarans take the opportunity to attack Gallifrey.
The Doctor is in Eden, remembering all his pasts including the ones which didn’t happen, when he senses the disturbance in the outer Universe. He is unable to focus the Effect as Omega had, and is thus unable to prevent the Sontaran attack on Gallifrey or Omega’s seizing control of the Eye of Harmony. His lover tells him to forget her and pass through the pathway opened between the two singularities to save Gallifrey. Omega has attained the power of a god, but when the Doctor arrives he points out that there will now be no challenge left in Omega’s life, as he can now cause anything to happen anywhere merely by thinking it so. Omega realizes that his new power has robbed his life of meaning but is unwilling to face an ordinary life now that he has tasted Godhood. He prepares to destroy the Universe along with himself, but the Doctor brings his own anti-singularity into contact with Omega’s singularity...
Of course there’s no such thing as an anti-singularity; on a quantum level the Doctor is just using his willpower to change reality, and he’s not really sure what happens next. But Omega is nowhere to be seen, the Eye of Harmony has been restored, and all seems back to normal. The Doctor finally remembers to release Sontar and the Rutan from the TARDIS, to find that as they were trapped for hours, unable to kill each other or escape, they eventually learned to talk to each other and have forged the beginning of a peace between their two races. Larna decides to take a position on the taskforce cleaning up the side-Effects of the Effect, a position which will take her away from Gallifrey for the next two thousand years. The Doctor, realizing that nothing will ever change the Gallifreyan status quo, looks out to the stars, pondering what to do next, where to go...