In the summer of 1999, spherical sections of reality suddenly vanish from around the Swedish village of Strängnäs. Kerstin Bergmann’s lover Johann vanishes along with half of their forest cabin, and when the stunned Kerstin reports his disappearance to the police she learns that six other people have vanished as well. Unable to return to her cabin, she seeks shelter with local farmer Björn Andersson, who has just shot an unearthly reptilian animal which was attacking the pigs on his farm. Björn’s wife was killed in an accident some time ago, and at first, he doesn’t want his sullen solitude disturbed; but when he realizes that Kirsten has also lost someone she cares about he agrees to report the incident.
As Fitz approaches Sam’s room in the TARDIS to apologise for the death of Ed Hill, the TARDIS is punctured by a spatial distortion and Sam is sucked out of the ship before Fitz’s eyes. The Doctor and Fitz are both expelled from the TARDIS into the Swedish forest, where they encounter a dragonfly-like insect which is like nothing on Earth. They hitch a ride into Strängnäs, where Fitz attracts the attention of the police when he sees Kirsten leaving the police station and momentarily mistakes her for Sam. The Doctor cites his UNIT credentials and offers to help investigate, and although Inspector Nordenstam is skeptical at first he agrees to let them study the body of the creature found at Björn’s farm. The Doctor concludes that these animals are harbingers of an alien invasion, and that the invaders attempted to kill him to prevent him from interfering but somehow got Sam instead.
Nordenstam takes Fitz to the forest, where another dead alien creature has been found, but before Fitz can study it the body is put into quarantine by the State Biohazard Protection Unit. Johann reappears in a state of shock, and is taken to the hospital, where the Doctor takes a sample of his blood, intending to analyse it back in the TARDIS. But when he reaches the TARDIS he finds that it has been so severely damaged that its exterior has reverted to a grey nondescript shape, without a door. He returns to the hospital just as Johann recovers consciousness -- and pink alien creatures like the kind Nordenstam and Fitz saw in the forest burst out of his body, killing him before Kerstin’s eyes. The Doctor and Fitz usher the shocked Kerstin out of the hospital, but when they return they find that Johann’s body has disappeared along with the physician who was attending him, Dr Lindgard. Nordenstam contacts his superiors for instructions, and learns that the State Biohazard Protection Unit does not exist.
The Doctor, Fitz and Kirsten return to Björn’s farm, but it is attacked by dozens of the reptile creatures and Björn is killed. The reptile creatures then die for no immediately apparent reason, just as the “SBPU” arrives to burn down the farm and destroy all evidence of their existence. The leader of the SBPU turns out to be Lindgard, and Fitz and Kerstin flee into the forest when Lindgard shoots the Doctor with an anaesthetic dart. The SBPU team takes the Doctor into a secret underground base, and Fitz and Kerstin follow them and find the way in. When the Doctor recovers he is greeted by Professor Jennifer Nagle, an American physicist working for Department C-19, the British agency in charge of alien technology collected by UNIT during its operations. Nagle has reverse-engineered an alien warp drive to create a telecongruency warp generator, which she hopes will provide the human race with instantaneous travel between two spatial nodes. However, something has gone wrong, and the Doctor soon determines that the TC warp has created a self-sustaining wormhole between the Earth and another world. Not only have creatures from the other world arrived on Earth, but the wormhole is growing and could consume the entire planet if not closed.
Sam awakens in a vast, low-gravity cavern illuminated by a sea of liquid light. She is captured by the green-skinned natives and flown through the sky-sea to another such cavern, where the natives tie her up and sacrifice themselves to an enroaching black void. Sam is rescued at the last minute by a native named Itharquell, who gives her an enzyme drink which enables them to communicate telepathically. The cavern universe, which Itharquell knows only as the Dominion, is being destroyed by the dark Blight, and as it shrinks the T’hiili and their warrior caste, the T’vorha, are being forced into confrontations with the reptilian Bane, and the Ruin, who lay their eggs in the T’hiili’s living bodies. Following the death of their Queen, most of his species, the T’hiili, have turned to ritual suicide. Only Itharquell holds out hope that, somewhere, a new Queen has hatched whom he can impregnate to ensure the survival of a new generation. All seems lost, but Sam is convinced that she can find a way out for the T’hiili.
Before the Doctor can find a way to close the wormhole, the entire project is shut down by its head of security, Major Gareth Wolstencroft of UNIT, due to the breach of security at Björn’s farm. When the Doctor objects, Major Wolstencroft has him arrested; he despises the Doctor, who always manages to survive events which end up getting good soldiers killed. Fitz and Kerstin witness this and convince Nagle to free the Doctor, who returns to the TC warp unit and attempts to reopen the portal to find out what’s on the other side. Wolstencroft discovers them too late to stop the Doctor, and when the portal opens, two Ruin and a surprised T’vorha warrior emerge into the lab. In the resulting confusion, Fitz and Kerstin plummet into the wormhole, and while Fitz ends up in the Dominion, Kerstin finds herself in a field full of butterflies -- all that remains of the interior of the TARDIS.
The Ruin are killed by their exposure to Earth’s relatively high gravity, and Wolstencroft shoots the T’vorha when it attacks Nagle, terrified by its new environment. The Doctor reads the dying T’vorha’s mind and learns of the Blight, and concludes that the wormhole is sustaining itself by draining energy from the Dominion; Nagle’s experiment may have resulted in the death of an entire race. The Doctor attempts to escape in order to get to the TARDIS, but when he tries to overpower the soldier guarding him, Lindgard is accidentally shot and killed. Nagle offers to remain behind to keep an eye on Wolstencroft; in fact, despite the Doctor’s insistence that Earth isn’t ready for this technology, she intends to salvage as much of her project as she can. Wolstencroft, meanwhile, concludes that Earth is being invaded from the other side of the wormhole, and orders Nagle to operate the TC warp drive and send a squad of soldiers to fight the enemy on the other side.
While Sam and Itharquell search the rapidly shrinking Dominion for the new Queen, the Ruin mass about the other end of the TC node, preventing any more T’hiili from getting through. Fitz encounters the new Queen, who has been brought to the node by her people, and she uses her telepathic enzymes to give Fitz a vision of the Blight and to cause him pain when he refuses to help. Realizing that the T’hiili have not discovered fire, Fitz uses his cigarette lighter to provide them with a new weapon. The UNIT troops arrive in the midst of the ensuing battle and are torn apart by the Ruin, and Nagle is forced to close down the node from the other side to prevent the base from being overrun.
The Doctor returns to his TARDIS, which Kerstin manages to open from the inside. After restoring the internal environment to normal he determines that a node of the wormhole is now embedded inside the TARDIS, and if he moves it may whiplash. He has no choice but to do so, and the resulting dimensional shift tears open the nodes and allows hundreds of Ruin to pass through to Earth. As the UNIT troops struggle to hold them back, the TARDIS materializes in the Dominion, where Sam and Itharquell have finally tracked down the T’hiili and their evacuation has been postponed while Itharquell fertislises the new Queen. The Doctor warns Sam and Fitz that the T’hiili will be unable to survive in Earth’s gravity, and alters the environment of the TARDIS butterfly room to give them a safe haven. Of the current T’hiili generation, only fourteen survive out of an entire Universe. Furthermore, when the Doctor dematerializes and gets a wide view of the Dominion and the wormhole, he realizes that the Blight was not caused by the wormhole at all, but by the expanding Universe drawing upon energy from outside itself; the Dominion was doomed in any case, and all the wormhole did was bring the Doctor here to save the last of the T’hiili.
The Ruin are eventually killed by the high gravity of Earth, and Nagle and Wolstonecroft return to the base to find the Doctor trying to shut down the wormhole before it collapses. Wolstonecroft tries to arrest him again, but the Doctor, Fitz and Sam manage to force him into the TARDIS as the critical moment draws near. Nagle rushes off to her office to rescue her notes, and is killed when the wormhole’s collapse destroys the base. Wolstonecroft, upon seeing the TARDIS’ schematic of the wormhole mapped out against the Universe, finally realizes that the Doctor has been working from a bigger perspective than he had understood. The Doctor returns Wolstonecroft to the remains of his base to deal with the aftermath, but while scanning to ensure that the wormhole has completely closed down he finds that something has damaged reality in San Fransisco, the site of his most recent regeneration. When Kerstin asks the Doctor for permission to come with him, he refuses, telling her only that she is going to live a long and fulfilling life on Earth and that his life is too dangerous for her. Before taking Sam and Fitz to San Fransisco, he drops Kerstin off in Strängnäs, where she must come to terms with her newly shattered life.