One day in medieval Suffolk, the inhabitants of the village of Wulpit hear a strange sound like a pulsing heartbeat, and Shepherd Mullen sees the ground subside, revealing a cave in which he can hear two children crying. The villagers rescue the children, a boy and a girl, only to discover that the children have bright green skin. The children are unable to speak English, and the touch of the boy’s hands calms his short-tempered sister and heals the crippled Jude. The village Squire, Richard de Calne, names the children Julien and Dominique after his parents, but despite his attempts to care for the children, many of the villagers view their unnatural skin colour with suspicion and fear. Julien falls ill, and telepathically communicates with his friends, telling them that the effort of healing Jude was too much for him to handle; he and his sister must return to the cave and try to find their way back home. The Squire takes the children back to the cave only to find that the frightened Brother Lucien and Shepherd Mullen have sealed it up with thatch and mud. Julien dies before the cave can be opened again, and without his healing presence to hold her back, the enraged Dominique attacks and kills both Mullen and Lucien and flees into the woods. The Squire follows her, but does not come back out again, and the frightened villagers burn down the entire forest.
The Doctor decides to visit his friend Professor Rummus at the Library of Carsus, but while he’s picking up a book from the TARDIS library, Mel sees that one of the roundels on the console room’s wall has been replaced by a photograph of herself standing next to an unfamiliar girl. The Doctor then walks back into the console room -- several times over. One of the Doctors is dressed in black, has a scar across one eye, and is accompanied by an alternative version of Mel herself. The Doctors communicate with one another, trying to put together all of their knowledge into a coherent picture, but vanish before Mel learns anything other than their suspicion that this is the work of something called the Lamprey. Mel’s own Doctor then returns to the console room, and reveals that a future incarnation of himself has just contacted him and told him that it is vital that he visit Carsus as planned.
In Bucharest, Professor Joseph Tungard has lived through World War Two and survived a number of occasionally inexplicable events that could have killed him; however, he falls foul of the new Soviet government when he steps up to defend his friend, Dr Emile Schwartz, who has been accused of collaborating with the Nazis. Tungard and his wife, Natjya, are arrested for harbouring criminals when the Schwartz family seeks shelter with them, but Tungard is too public a figure to “disappear,” and he and his wife are thus exiled to Britain. On their trip to London, they are befriended by a young Englishwoman named Monica and her grandfather, Dr Pike -- who tends to Natjya when she falls ill on the crossing.
Meanwhile, in Britain, Sir Bertrand Lamprey’s schedule unexpectedly changes, and as a result he is the one who takes his daughter Helen to London for a doctor’s appointment while his wife Elspeth remains at home to discuss the upcoming Christmas fete with the ladies of the village. When Sir Bertrand and Helen return, they find that the Hall has gone up in flames, taking Elspeth with it. In another time and another part of Britain, two grieving parents visit their young daughter’s grave for the last time; Al and Chrissie have decided to move to a different part of the country, to put this tragedy behind them and try to raise their surviving daughter without recriminations or anger...
The library of Carsus is shaped like a pentagon, like a Masonic temple in deep space; as the Doctor and Mel walk through the corridors, Mel notes that it takes exactly seven minutes to walk from one junction to the next, just as it does in the US Pentagon. She and the Doctor reach the Head Librarian’s office only to find Rummus’ body slumped over his desk and the Doctor’s body lying next to it, both murdered. Rummus then walks into the room, very much alive, and as the bodies vanish, he reveals that he’s seen three similar visions over the past week. Carsus is located in an area of space known for temporal anomalies, but it shouldn’t be possible for any of them to affect the interior of the Library. Rummus also reveals that this sector is known for pentagonal architecture, but there are only four planets outside this sector of space known to have similar buildings -- and each of them is registering abnormally high levels of chronon energy.
Mel and the Doctor discuss the situation with Rummus over dinner, and Mel, reminded of Christmas dinners with her parents and her sister, suddenly feels an inexplicable chill. Unsure what has so unnerved her, she decides to explore the Library. In the Reading Room, she meets two Custodians, Mr Woltas and Mr Huu, who recognise her on sight and offer to give her the books that she’d asked for. When she claims not to have asked for any books, the disturbed Custodians leave the room, and when they apparently return, moments later, they have no idea who Mel is -- for they haven’t yet met her.
Mel and the Custodians report the incident to Rummus, who sends the Custodians to fetch a time path indicator. Moments after the Custodians have left, the Doctor and Rummus apparently enter the room; however, they fail to notice Mel trying to attract their attention. The Doctor and Rummus are discussing the implications of the Library having gone non-linear, which could be an indication that the Vortex Spiral has been scratched, resulting in chronon spillage that is causing the many different timelines of the multiverse to overlap. Chaos could ensue if the scratch is not repaired, and Rummus therefore asks the Doctor to take Melanie to the planet Schyllus to investigate the high levels of chronon energy on that planet. The Doctor and Rummus then vanish into thin air -- and moments later, another Doctor and Rummus enter the Reading Room. Mel is able to interact with these two, who are from her own timeline, and her story seems to confirm the other versions’ fear that the timelines are overlapping. Disturbed, Rummus tells the Doctor and Mel that he’s detected a potential trouble spot on Earth in the year 1958, where a woman named Helen Lamprey is about to vanish from her 16th birthday party.
The Doctor and Mel crash Helen’s party at Wikes Manor in Wendlestead, Suffolk; this area is known for paranormal occurrences, including the strange incident at the nearby village of Wulpit in the 12th century. Sir Bertrand put aside his political ambitions after the fire to raise his daughter, and she has grown into an intelligent, charming young woman. The Doctor wins Helen over by praising her abstract art, including an image of a pentagonal building; however, Mel isn’t as impressed by the young socialite, and goes off to have a drink by herself. She then hears someone telling her to remember her sister, and the Doctor appears at her shoulder only to take a look at her and realise that she is not “his” Melanie. The timelines are overlapping again, and Mel’s Doctor is still talking with Helen. The alternative Doctor vanishes, and as Mel tries to tell her Doctor what happened, the entire party freezes in a moment of Time, apart from the Doctor; Helen, who is still moving in slow motion; and Sir Bertrand, who, like the Doctor, is moving normally. The Doctor holds Mel out of the frozen moment while the house’s roof vanishes, revealing a giant wormlike creature that Mel instinctively identifies as a Lamprey. The Doctor is forced to let go of Mel while trying to save Helen, but he fails; the Lamprey takes Helen with it, and the party resumes -- with some significant changes. The party is now, and has always been, for Sir Bertrand’s wife Elspeth, who lost her husband and daughter in a tragic fire some years ago. Sir Bertrand also vanishes, as does the entire house moments after the Doctor and Mel emerge from it. Despite these bizarre occurrences, Mel, an only child, finds herself more unaccountably disturbed by the other Doctor’s apparent belief that she had a sister.
The Lamprey raids a number of other timelines, kidnapping certain individuals; each time, the timeline’s inhabitants hear a sound like a gigantic heartbeat before being frozen in a single moment of Time for all eternity. DiVotow Nek, a young boy from Utopiana City who dreams of becoming a scientist, is snatched away from his home when the Lamprey appears in the sky. In another timeline, the races of the galaxy have united to defeat the fiendish Nazis of Earth, destroying the planet in the process; however, celebrations come to an abrupt halt when the Lamprey freezes Time and kidnaps an expatriate human named Haema Smith from the planet Halox V, incidentally taking along her close friend and potential lover, Marlern Jarl. In yet another timeline, Kevin Dorking, the fastest star-dragster in human space, is taken while running a race in Earth’s solar system. The Lamprey’s fourth intended victim, a young girl named Kina, proves unavailable; nevertheless, the Lamprey sets its plans in motion by restraining the other three in a machine that drains the chronon energy out of their bodies and into the unconscious Helen Lamprey.
In an alternative timeline in which Britain is ruled by the Roman Empire under Princess Margarita, a Doctor who is scarred and dressed in black visits his old friend, Praetor Linus, to ask for help in repairing the TARDIS’ image translator. Linus knows the story of how the Doctor received the scars, in a battle with the warlord Dominicus that cost the life of his companion Perpugilliam Brown; he thus offers the Doctor the run of his advanced IT department. Without the Doctor’s knowledge, however, Linus orders his bodyguard, Captain Rovia, to kill the guardsman who happened to see the Doctor’s TARDIS materialise. The Doctor visits the IT department, and somewhat cruelly questions the supposedly utopian Roman Empire’s need for slaves; he does not push the question further, but he does notice a young red-haired slave named Melina, and decides to take her into his service, sensing something special about her that he can’t quite explain to himself.
Joseph and Natjya Tungard have settled in England, but Natjya’s illness has grown worse since their arrival, and while Dr Pike has been tending to her, Joseph and Monica have become lovers. Despite Monica’s show of concern for her friend, it seems that privately, she would prefer Natjya to just pass on as quickly as possible. Dr Pike reveals to Joseph that Natjya has contracted tuberculosis and will be dead within months; however, that isn’t soon enough for Monica, who lashes out at her “grandfather” after his diagnosis, demanding to know why Natjya has survived even this long. However, she now has another problem to deal with: a philanthropist named Sir Bertrand Lamprey has offered to fund Joseph’s latest research -- and since Monica is a Lamprey herself, the possible arrival of a Lamprey from an alternative timeline causes her some grave concern.
The alternative Doctor whom Rummus had sent to Schyllus arrives with his companion, the half-human, half-Silurian Melanie Baal. The planet seems deserted, apart from a young girl named Kina who is hiding from the “pulsebeat” that caused everyone else to stop. As the Doctor theorises that the other inhabitants of the planet have been shifted into a different time phase, Kina sketches a design in the sand, like a spiral with a scratch through it. She is then unexpectedly possessed by the spirit of her father, Hemp, who reveals that this is a natural ability of his people that he is using to communicate with the Doctor. Before he or the Doctor can work out what’s happening, the Lamprey arrives and tries to kidnap Kina, a natural time sensitive whom it requires in order to further its plan. The Doctor identifies the Lamprey as a creature that lives in the time vortex and feeds off chronon energy, and he and Mel hurry Kina into the TARDIS before the Lamprey can take her. Realising that the Lamprey may be attacking alternative versions of himself in other timelines, the Doctor sets course back to the Library, where he knows that Rummus keeps an ancient Gallifreyan artefact known as the Spiral Chamber. As he nears the Library, however, an alternative, fully human version of Mel appears in the console room, and the Doctor realises from her behaviour that she is interacting with multiple versions of himself, which he is unable to perceive; this must mean that she, and not he, is from the primary timeline. Too late, he realises that the Lamprey allowed him to escape with Kina so that he would return to the Library of his own accord; it is presumably trying to get as many versions of the Doctor as possible to the Library in order to feed on their accumulated chronon energy. To defeat the Lamprey, however, the Doctor must step into its trap.
As the “prime” Doctor and Mel return to Carsus, Mel reads up on the Spiral, the home of the Lampreys and the vortex at the centre of all creation. The Lampreys’ nature is not fully understood, but one theory holds that they are all iterations of a single creature. If anything were to damage the Spiral, the resulting chronon spillage would provide the Lampreys with a food source for all eternity. The Doctor and Mel then arrive at the Library to see a time-shifted man and woman arguing over another alternative version of Rummus’ body. The living Rummus takes a photograph of the figures before they vanish, and Mel notes that the woman’s handbag is monogrammed ML and guesses that the L stands for Lamprey. Rummus uses a research database to identify the man, but does not tell Mel what he’s learned, claiming that too much future foreknowledge could prove dangerous. Curious, Mel slips away while the Doctor and Rummus plan their next move, and looks up her own history, only to find that there are at least 117,863 other Melanie Jane Bushes out there -- and that doesn’t count versions with different names. She also bumps into her half-Silurian counterpart, Melanie Baal, and although they only interact briefly, the two Melanies get along quite well together.
The alternative Doctor and Melanie Baal visit Helen Lamprey’s birthday party, but in this timeline, the party is held on a space station in orbit around the Earth. While Helen’s faithful bodyguard, Chakiss, keeps a watchful eye on the guests, the Doctor wanders through the hall and runs into Melanie -- the human Melanie. The alternative timelines are merging with one another, and the two parties are overlapping; this is the same conversation that Mel had at Wikes Manor, from the other end. Mel vanishes from the Doctor’s perspective, and events then unfold roughly as they did at the other party; Chakiss turns out to be a servant of the Lamprey, and he summons it to the station, where it takes Helen before the Doctor can stop it. The Doctor and his Melanie return to Carsus to warn Rummus that they have failed.
The “prime” Doctor and Mel visit a restaurant on Charing Cross Road, where Sir Bertrand has invited Joseph and Natjya to dinner to discuss their funding. Monica has pressured Joseph into inviting her along in order to find out who “Sir Bertrand” really is, and when the Doctor and Mel arrive, they recognise Monica and Joseph as the killers from the Library. The Doctor is thrown when Monica casually confirms that she is the Lamprey and that she has been killing off alternative versions of Rummus in order to prevent him from interfering in her plans. Monica has been manipulating Joseph, seducing him into an affair and then blackmailing him into using his research to develop chemicals that can be used to create rifts between alternative timelines. She intends to travel through these rifts, seal off the timelines within millisecond-long time loops, and feed off the ensuing release of chronon energy. This will result in possibly irreparable damage to the Spiral, however -- and the fact that the timelines are already overlapping indicates that her plan will succeed in the future.
These revelations trigger Sir Bertrand’s buried memories, and he realises that he is a Lamprey from an alternative timeline. Monica, who was once known as Dominique, is one of the two lost Lamprey children who ended up in Wulpit; Sir Bertrand pursued them there but lost track of them, and thus rode the time winds to a future era in the same location and settled down as a human, creating a base of operations from which to search for the missing child. However, he then met Elspeth and fell in love, and deliberately suppressed his own memories so that he could live with his human bride. Now he remembers his mission, transforms into a Lamprey and attacks Monica, trying to kill her.
As the two Lampreys battle each other, waves of temporal energy wash through the restaurant, aging the other patrons to dust within seconds. The Lampreys’ dinner guests shelter in the eye of the storm, and Dr Pike tells Joseph that Natjya should have died years ago so that Joseph’s attention was no longer divided between her and Monica; ironically, however, the temporal energy bleeding away from Monica has kept Natjya alive all this time. The Doctor, seeing the carnage resulting from the Lampreys’ battle, begs Sir Bertrand to stop, and one of the Lampreys transforms into Bertrand’s human form and banishes the other into the Vortex. The Doctor realises that Bertrand’s daughter is a unique half-human and half-Lamprey hybrid, and that Monica needs her to achieve her objectives. He and Mel rush off, accompanied by Joseph, who is unsure what’s going on but realises that he is in some way to blame for these events. As soon as they have gone, however, “Sir Bertrand” transforms into Monica, who reveals that she banished the real Sir Bertrand Lamprey to the Vortex. Pike and Natjya have long outlived their usefulness, and Monica thus drains the chronon energy from their bodies, killing them and preparing herself for the final battle with the Doctor -- and the destruction of the Spiral.
Unaware of these events, the Doctor, Mel and Joseph return to the TARDIS, only to find multiple Doctors filling the console room; the other Doctors return to their own timelines one by one until only two are left, and one of those vanishes after asking Mel if she has a sister named Annabel. The Doctor sets course for Carsus, now convinced that it is the source of the disturbances, and demands that Rummus reveal the truth. Meanwhile, Joseph, fascinated by the advanced technology he’s seen, tries looking up his own history on one of the Library computers, and discovers that he has always been destined to discover new atomic elements capable of ripping open the Spiral and unleashing the Lampreys upon the whole of creation; other time-travellers have been trying to kill him all his life, but the Lampreys have intervened to keep him alive. Monica then materialises in the Library and casts Mel back into her own past, revealing the incident that makes her unique out of all the other Melanies in the multiverse: back when she was 18 months old, she accidentally killed her three-year-old sister Annabel by tripping her up at the top of the stairs. Rather than collapsing in despair, Mel focuses her anger and punches Monica in the face, and the furious Monica flings Mel out of the Library into another alternative timeline.
Meanwhile, Rummus is forced to admit to the Doctor that this is all his fault; however, he also claims that the problem is now solved. Rummus had stolen an ancient Gallifreyan artefact called the Spiral Chamber with the intention of studying the Spiral directly and learning the truth about the Lamprey; however, doing so provided the Lamprey with its first access to the multiverse. As far as he’s aware, he has been observing it ever since, without making any attempt to stop its plans -- but this is only because it has been rewriting his own history, and the versions of himself who posed a threat were all murdered by Monica and Joseph. Rummus has learned that the Lamprey needs a lodestone with which to anchor itself to reality, so that it can create a home base from which feed off the multiverse rather than drifting aimlessly through the timelines; that lodestone is Helen, who exists in one out of every five timelines. To tap Helen’s latent abilities and transform her into a lodestone, the Lamprey has kidnapped time-sensitives from the other four Universes and is draining their chronon energy into Helen’s body. However, the Helen Lamprey from the primary timeline is the daughter of Sir Bertrand, which makes her the weak link in the chain. Rummus now reveals that he monitored the confrontation in the restaurant, and as soon as Sir Bertrand flung Monica into the Vortex, he and the Custodians grabbed her, sealed her up in the Spiral Chamber and killed her; from this point on, the temporal disturbances should start to resolve. However, the furious Doctor reveals that, as always, Monica has anticipated Rummus’ actions and prepared for them -- and that Rummus has killed the wrong Lamprey, Sir Bertrand, the only being who could possibly have helped them to defeat his evil counterpart.
Mel has been transported to the planet Janus VIII, where she is rescued by the alternative Roman Doctor and her counterpart Melina -- who is not acclimatising well to being taken away from everything she knew. Mel notices the Doctor’s scar, and he admits that he acquired it when his companion Peri was killed by a barbarian warlord who sought to make her his queen; the Doctor told his friends that she died heroically in combat, and kept the scar to remind himself of her. The Roman Doctor then takes Melina and Mel back to the Library, where they are joined by Mel’s Doctor and the alternative Doctor with Melanie Baal. The three Doctors compare notes and conclude that Monica has hidden Helen Lamprey in a subspace universe, away from ordinary Time; there, she is transforming Helen into the temporal lodestone with which she can seal off timelines from the Spiral so that she can feed on the resulting release of chronon energy. Joseph is the key to her victory, due to his discovery of the chemicals that will enable her to rip holes in the fabric of reality. He thought that the murders in which he was participating were a series of bad dreams, but in fact he was killing off alternative versions of Rummus, thus depleting the total chronon energy in the Library until it reached a safe level; now, Monica can use the Library to store the chronon energy released by the destruction of alternative timelines. She has now manipulated Rummus into killing Sir Bertram, the only creature powerful enough to pose a threat to her plan.
The only way to defeat the Lamprey now is to overfeed it, giving it so much chronon energy that it fills itself to bursting. Before confronting the Lamprey for the final time, the Doctors plan to weaken it by rescuing Helen and the time-sensitives. Joseph mixes up the chemicals that will open a rift into the subspace Universe, but the three Melanies, realising that their Doctors need time to prepare for the final battle, go through the rip to rescue the Lamprey’s victims themselves. They are aided by Marlern Jarl, whom Monica has ignored because he was brought along by accident; however, as they remove Helen and the time-sensitives from the machine, Monica finds Joseph and kills him, as he has outlived his usefulness to her. She then tries to prevent the time-sensitives from escaping, and when Marlern and Haema Smith try to hold her back, Monica sweeps straight through them, reducing them both to dust. The others escape through the rift, but the Roman Melina hesitates to destroy the chemicals that are keeping the rift open, fearing that she could be hurt. Melanie Baal sweeps them to the floor without hesitation, and is instantly incinerated, to Melina’s shame.
The Doctor explains to Mel that Helen is now helping them to set a trap, and Mel at first believes that he’s planning to use Helen as bait -- before realising that he’s actually planning to use himself. Helen is going to use her power as a half-Lamprey to open up the alternative timelines and allow multiple Doctors to interact within the Library, and the alternative Doctors are all going to allow the Lamprey to feed off their accumulated chronon energy. This will cost the lives of many of the alternative Doctors, and Rummus blames himself, knowing that his friend is going to have to die many times over because Rummus meddled with the Spiral without knowing what he was doing.
The alternative Doctors enter the Spiral Chamber, and Mel can do nothing but watch as the Lamprey arrives and begins to feed off them. Melina tries to atone for her earlier hesitation by confronting the Lamprey, but it blasts her out of existence with a gesture. The Doctors successfully overfeed the Lamprey as planned, although many of the alternative Doctors and their companions blink out of existence as the Lamprey drains them completely; eventually, however, it has fed on so much chronon energy that it finds itself bound to this one time and space, and Mel’s Doctor then leaps into the Spiral Chamber and tackles it, keeping it pinned. The remaining Doctors focus their last blasts of chronon energy into the Lamprey, filling it up until it burns away to nothing.
With the prime Lamprey’s destruction, the alternative Lampreys are destroyed as well -- sadly, including Helen. The surviving Doctors return to their own timelines, while Mel’s Doctor emerges from the Spiral Chamber, exhausted by his efforts. Rummus and the Custodians set off to ensure that the omniverse is indeed free of all trace of the Lamprey, and the Doctor leaves them to it, content that he’s won the battle. However, to Mel’s horror, the Doctor seems to be growing older before her eyes, and he admits that the blasts of chronon energy he absorbed during the last moments in the Spiral Chamber have ravaged his body. He returns to the TARDIS and materialises in deep space for one last look at the Universe he gave his life to protect -- but the moment of peace is broken when a tractor beam hauls the TARDIS off course. The Doctor collapses before he can reach the controls, and the turbulence hurls Mel to the floor, knocking her unconscious. As she passes out, she hears a woman entering the TARDIS and ordering her subordinate: “Leave the girl, it’s the man I want...”